Dymo.Tagger behaviour (Dymo v3.0.3) View Source
Defines the functions required for a tagger to be compabible with the Dymo.Taggable macro.
Link to this section Summary
Functions
Use this module to implements alternative Ecto.Tagger
A helper function that helps computing the field name to use in taggings queries.
A helper function that generates the join table name to be used for a given schema or model.
Callbacks
See Dymo.TaggerImpl.add_labels/{2,3}
.
See Dymo.TaggerImpl.add_labels/{2,3}
.
See Dymo.labeled_with.labels/4
.
See Dymo.labeled_with.labels/4
.
See Dymo.TaggerImpl.labels/{3,4}
.
See Dymo.TaggerImpl.labels/{3,4}
.
See Dymo.TaggerImpl.tags/{3,4}
.
Link to this section Types
Link to this section Functions
Use this module to implements alternative Ecto.Tagger
By default, all functions are delegated to Ecto.Tagger
but can be overriden
Specs
join_key(Ecto.Schema.t() | module() | String.t()) :: atom()
A helper function that helps computing the field name to use in taggings queries.
Examples
iex> Tagger.join_key(Dymo.Post)
:post_id
iex> Tagger.join_key(%Dymo.Post{})
:post_id
iex> Tagger.join_key(Person)
:person_id
Specs
join_table(Ecto.Schema.t() | module() | String.t()) :: String.t()
A helper function that generates the join table name to be used for a given schema or model.
Examples
iex> Tagger.join_table(Dymo.Post)
"posts_tags"
iex> Tagger.join_table(%Dymo.Post{})
"posts_tags"
iex> Tagger.join_table(Person)
"people_tags"
Specs
singularize(Ecto.Schema.t() | module() | String.t()) :: String.t()
Link to this section Callbacks
Specs
add_labels(Ecto.Schema.t(), Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
See Dymo.TaggerImpl.add_labels/{2,3}
.
Specs
add_labels(Ecto.Schema.t(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Schema.t()
See Dymo.TaggerImpl.add_labels/{2,3}
.
Specs
all_labels(join_table(), join_key()) :: Ecto.Query.t()
Specs
all_labels(join_table(), join_key(), keyword()) :: Ecto.Query.t()
Specs
labeled_with(module(), Dymo.Tag.label_or_labels(), join_table(), join_key()) :: Ecto.Query.t()
See Dymo.labeled_with.labels/4
.
Specs
labeled_with( module(), Dymo.Tag.label_or_labels(), join_table(), join_key(), keyword() ) :: Ecto.Query.t()
See Dymo.labeled_with.labels/4
.
Specs
labels(Ecto.Schema.t(), join_table(), join_key()) :: Ecto.Query.t()
See Dymo.TaggerImpl.labels/{3,4}
.
Specs
labels(Ecto.Schema.t(), join_table(), join_key(), keyword()) :: Ecto.Query.t()
See Dymo.TaggerImpl.labels/{3,4}
.
Specs
remove_labels(Ecto.Schema.t(), Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
Specs
remove_labels(Ecto.Schema.t(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Schema.t()
Specs
set_labels(Ecto.Schema.t(), Dymo.Tag.label_or_labels()) :: Ecto.Schema.t()
Specs
set_labels(Ecto.Schema.t(), Dymo.Tag.label_or_labels(), keyword()) :: Ecto.Schema.t()
Specs
tags(Ecto.Schema.t(), join_table(), join_key()) :: Ecto.Query.t()
See Dymo.TaggerImpl.tags/{3,4}
.