Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule Billout.Authorization.Role do
- use Ecto.Schema
- import Ecto.Changeset
- alias Billout.Authorization.Permission
- schema "roles" do
- field :name, :string
- has_many :permissions, Permission
- timestamps()
- end
- @doc false
- def changeset(role, attrs) do
- role
- |> cast(attrs, [:name])
- |> validate_required([:name])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement