View Source StepFlow.Roles (StepFlow v1.8.0)
The Roles context.
Summary
Functions
Returns an %Ecto.Changeset{}
for tracking role changes.
Creates a role.
Deletes a Role.
Gets a single role by name
Gets a single role by name
Gets a single role.
Gets a single role.
Gets a several roles.
Returns the list of roles.
Updates a role.
Functions
Returns an %Ecto.Changeset{}
for tracking role changes.
Examples
iex> change_role(role)
%Ecto.Changeset{source: %Role{}}
Creates a role.
Examples
iex> create_role(%{field: value})
{:ok, %Role{}}
iex> create_role(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Deletes a Role.
Examples
iex> delete_role(role)
{:ok, %Role{}}
iex> delete_role(role)
{:error, %Ecto.Changeset{}}
Gets a single role by name
Examples
iex> get_by(toto)
%Role{}
iex> get_by(tata)
nil
Gets a single role by name
Examples
iex> get_by!(toto)
%Role{}
iex> get_by!(tata)
** (Ecto.NoResultsError)
Gets a single role.
Examples
iex> get_role(123)
%Role{}
iex> get_role(456)
nil
Gets a single role.
Raises Ecto.NoResultsError
if the Role does not exist.
Examples
iex> get_role!(123)
%Role{}
iex> get_role!(456)
** (Ecto.NoResultsError)
Gets a several roles.
Examples
iex> get_roles(["toto", "tata"])
[%Role{}, %Role{}]
Returns the list of roles.
Examples
iex> list_roles()
[%Role{}, ...]
Updates a role.
Examples
iex> update_role(role, %{field: new_value})
{:ok, %Job{}}
iex> update_role(role, %{field: bad_value})
{:error, %Ecto.Changeset{}}