View Source Boruta.Ecto.Admin.Scopes (Boruta core v2.0.0)

Boruta.Ecto.Scope resource administration

Link to this section Summary

Functions

Creates a scope.

Deletes a Scope.

Gets a single scope.

Return scopes corresponding to the given ids.

Return scopes corresponding to the given names.

Returns the list of scopes.

Updates a scope.

Link to this section Functions

Link to this function

create_scope(attrs \\ %{})

View Source

Creates a scope.

Examples

iex> create_scope(%{field: value})
{:ok, %Scope{}}

iex> create_scope(%{field: bad_value})
{:error, %Ecto.Changeset{}}

Deletes a Scope.

Examples

iex> delete_scope(scope)
{:ok, %Scope{}}

iex> delete_scope(scope)
{:error, %Ecto.Changeset{}}

Gets a single scope.

Raises Ecto.NoResultsError if the Scope does not exist.

Examples

iex> get_scope!(123)
%Scope{}

iex> get_scope!(456)
** (Ecto.NoResultsError)

Return scopes corresponding to the given ids.

Examples

iex> get_scopes_by_ids(["9864decf-8aa4-4387-a7e4-19d1a059c912", "7b6ec16d-ad8f-4332-ac55-559184ec0f51"])
[%Scope{}, ...]
Link to this function

get_scopes_by_names(names)

View Source

Return scopes corresponding to the given names.

Examples

iex> get_scopes_by_names(["first:scope", "second:scope"])
[%Scope{}, ...]

Returns the list of scopes.

Examples

iex> list_scopes()
[%Scope{}, ...]
Link to this function

update_scope(scope, attrs)

View Source

Updates a scope.

Examples

iex> update_scope(scope, %{field: new_value})
{:ok, %Scope{}}

iex> update_scope(scope, %{field: bad_value})
{:error, %Ecto.Changeset{}}