Boruta.Ecto.Admin.Scopes (Boruta core v2.3.5)

View Source

Boruta.Ecto.Scope resource administration

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.

Functions

create_scope(attrs)

Creates a scope.

Examples

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

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

delete_scope(scope)

Deletes a Scope.

Examples

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

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

get_scope!(id)

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)

get_scopes_by_ids(ids)

Return scopes corresponding to the given ids.

Examples

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

get_scopes_by_names(names)

Return scopes corresponding to the given names.

Examples

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

list_scopes()

Returns the list of scopes.

Examples

iex> list_scopes()
[%Scope{}, ...]

update_scope(scope, attrs)

Updates a scope.

Examples

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

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