mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-03 16:17:59 +01:00
21 lines
399 B
Elixir
21 lines
399 B
Elixir
defmodule Philomena.Users.Role do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
alias Philomena.Users.User
|
|
alias Philomena.Roles.Role
|
|
|
|
@primary_key false
|
|
|
|
schema "users_roles" do
|
|
belongs_to :user, User, primary_key: true
|
|
belongs_to :role, Role, primary_key: true
|
|
end
|
|
|
|
@doc false
|
|
def changeset(role, attrs) do
|
|
role
|
|
|> cast(attrs, [])
|
|
|> validate_required([])
|
|
end
|
|
end
|