philomena/lib/philomena/forums/subscription.ex
2019-11-16 18:42:48 -05:00

21 lines
436 B
Elixir

defmodule Philomena.Forums.Subscription do
use Ecto.Schema
import Ecto.Changeset
alias Philomena.Forums.Forum
alias Philomena.Users.User
@primary_key false
schema "forum_subscriptions" do
belongs_to :forum, Forum, primary_key: true
belongs_to :user, User, primary_key: true
end
@doc false
def changeset(subscription, attrs) do
subscription
|> cast(attrs, [])
|> validate_required([])
end
end