Dymo v0.3.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

When doing so, the following functions will be added to the caller module:

  • all_labels/{0,1}
  • labeled_with/1

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.

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

Add labels to the given namespace

Returns all labels associad with the given schema

Returned all objects of given type labeled with given labels

Returns all labels of the given namespace

Remove labels of given namespace

Set all labels of 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

Add labels to the given namespace

Link to this function all_labels(module, ns \\ nil) View Source
all_labels(module(), Dymo.Tag.ns() | nil) :: Ecto.Query.t()

Returns all labels associad with the given schema

Link to this function labeled_with(module, tags) View Source
labeled_with(module(), Dymo.Tag.tag_or_tags()) :: Ecto.Query.t()

Returned all objects of given type labeled with given labels

Returns all labels of the given namespace

Link to this function remove_labels(taggable, label_or_labels) View Source

Remove labels of given namespace

Link to this function remove_labels(taggable, ns, label_or_labels) View Source

Set all labels of the given namespace, replacing existing ones.

Use this macro in your Ecto schema to add tags field