mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-22 21:33:08 +01:00
21 lines
448 B
Elixir
21 lines
448 B
Elixir
defmodule Philomena.Channels.Subscription do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
alias Philomena.Channels.Channel
|
|
alias Philomena.Users.User
|
|
|
|
@primary_key false
|
|
|
|
schema "channel_subscriptions" do
|
|
belongs_to :channel, Channel, 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
|