Dymo v0.1.2 Dymo.Tag View Source
This module provides functionality dedicated to handling tag data.
Link to this section Summary
Link to this section Types
The Dymo.Tag.t()
schema defines simple tags identified by
a unique label.
Link to this section Functions
Makes a changeset suited to manipulate the Dymo.Tag
model.
This function gets an existing tag using its label. If the tag doesn’t exit, it is atomically created. It could be described as a “singleton” helper.
Examples
iex> %{id: id1a} = Tag.find_or_create!("novel")
iex> [%{id: id2a}, %{id: id3a}] = Tag.find_or_create!(["article", "book"])
iex> [%{id: id1b}, %{id: id2b}, %{id: id3b}] = Tag.find_or_create!(["novel", "article", "book"])
iex> {id1a, id2a, id3a} == {id1b, id2b, id3b}
true