Dymo v1.0.3 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

Link to this section Functions

Link to this function

add_labels(taggable, lbls, opts \\ [])

View Source
add_labels(t(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Schema.t()

Adds labels to the given namespace.

Link to this function

all_labels(module, opts \\ [])

View Source
all_labels(module(), keyword()) :: Ecto.Query.t()

Returns all labels associad with the given schema.

Link to this function

labeled_with(module, tags, opts \\ [])

View Source

Returns all objects of given type labeled with given labels.

Link to this function

labels(taggable, opts \\ [])

View Source
labels(t(), keyword()) :: Ecto.Query.t()

Returns all labels in the given namespace.

Link to this function

remove_labels(taggable, label_or_labels, opts \\ [])

View Source
remove_labels(t(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Schema.t()

Remove labels from the given namespace.

Link to this function

set_labels(taggable, lbls, opts \\ [])

View Source
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.