Boruta.Ecto.Admin.Scopes (Boruta core v1.2.0) View Source

Boruta.Ecto.Scope resource administration.

Link to this section Summary

Functions

Creates a scope.

Deletes a Scope.

Gets a single scope.

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)

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{}}