Haytni.InvitablePlugin.QueryHelpers (Haytni v0.7.0) View Source
This module provides some basic helpers to query invitations to be independant and not have to know the internals of the Invitable plugin.
Link to this section Summary
Functions
Composes query to filter on accepted invitations
Composes query for token invitation to match code
Composes query for email to match the address it was sent to only if
email_matching_invitation
is true
(else returns the query as it was)
Composes query for invitation id (primary key) to worth id
Composes query to filter on non-accepted invitations
Composes query to filter on non-expired invitations
Returns a queryable for all invitations
Returns a queryable for all invitations sent by user
Link to this section Functions
Specs
and_where_accepted(query :: Ecto.Queryable.t()) :: Ecto.Query.t()
Composes query to filter on accepted invitations
Specs
and_where_code_equals(query :: Ecto.Queryable.t(), code :: String.t()) :: Ecto.Query.t()
Composes query for token invitation to match code
Specs
and_where_email_equals( query :: Ecto.Queryable.t(), email :: String.t(), config :: Haytni.InvitablePlugin.Config.t() ) :: Ecto.Queryable.t()
Composes query for email to match the address it was sent to only if
email_matching_invitation
is true
(else returns the query as it was)
Specs
and_where_id_equals( query :: Ecto.Queryable.t(), id :: pos_integer() | String.t() ) :: Ecto.Query.t()
Composes query for invitation id (primary key) to worth id
Specs
and_where_not_accepted(query :: Ecto.Queryable.t()) :: Ecto.Query.t()
Composes query to filter on non-accepted invitations
Specs
and_where_not_expired( query :: Ecto.Queryable.t(), config :: Haytni.InvitablePlugin.Config.t() ) :: Ecto.Query.t()
Composes query to filter on non-expired invitations
Specs
invitations_from_all(user :: Haytni.user()) :: Ecto.Query.t()
Returns a queryable for all invitations
Note: user is not used for the query, just to find the scope/table/association
Specs
invitations_from_user(user :: Haytni.user()) :: Ecto.Query.t()
Returns a queryable for all invitations sent by user