Dymo v2.0.0 Dymo.Taggable View Source
Allows to easily make models taggable.
To use this module, you can simply leverage the use
macro inside
your model module:
use Dymo.Taggable
Doing so will require you to have a join table set up between the model and Dymo.Tag
as well as a many_to_many
relationship on your model (or use the tag()
macro to declare
the relationship automatically).
For more information about their usage and typings, have a look at the Dymo.Tagger
behaviour and the Dymo.TaggerImpl
implementation.
Link to this section Summary
Functions
Adds labels to the given namespace.
Returns all labels associad with the given schema.
Returns all objects of given type labeled with given labels.
Returns all labels in the given namespace.
Remove labels from the given namespace.
Sets all labels with the given namespace, replacing existing ones.
Use this macro in your Ecto schema to add tags
field.
Link to this section Types
Specs
t() :: Dymo.Taggable.Protocol.t()
Link to this section Functions
Specs
add_labels(t(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Schema.t()
Adds labels to the given namespace.
Specs
all_labels(module(), keyword()) :: Ecto.Query.t()
Returns all labels associad with the given schema.
Specs
labeled_with(module(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Query.t()
Returns all objects of given type labeled with given labels.
Specs
labels(t(), keyword()) :: Ecto.Query.t()
Returns all labels in the given namespace.
Specs
remove_labels(t(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Schema.t()
Remove labels from the given namespace.
Specs
set_labels(t(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Schema.t()
Sets all labels with the given namespace, replacing existing ones.
Use this macro in your Ecto schema to add tags
field.