SHARE
TWEET

Untitled

a guest Sep 19th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. defmodule Billout.Authorization.Role do
  2.   use Ecto.Schema
  3.   import Ecto.Changeset
  4.   alias Billout.Authorization.Permission
  5.  
  6.   schema "roles" do
  7.     field :name, :string
  8.     has_many :permissions, Permission
  9.  
  10.     timestamps()
  11.   end
  12.  
  13.   @doc false
  14.   def changeset(role, attrs) do
  15.     role
  16.     |> cast(attrs, [:name])
  17.     |> validate_required([:name])
  18.   end
  19. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top