mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-02 23:57:59 +01:00
21 lines
416 B
Elixir
21 lines
416 B
Elixir
defmodule Philomena.Roles.Role do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
schema "roles" do
|
|
field :name, :string
|
|
|
|
# fixme: rails polymorphic relation
|
|
field :resource_id, :integer
|
|
field :resource_type, :string
|
|
|
|
timestamps(inserted_at: :created_at, type: :utc_datetime)
|
|
end
|
|
|
|
@doc false
|
|
def changeset(role, attrs) do
|
|
role
|
|
|> cast(attrs, [])
|
|
|> validate_required([])
|
|
end
|
|
end
|