mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
21 lines
492 B
Elixir
21 lines
492 B
Elixir
defmodule Philomena.Notifications.UnreadNotification do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
alias Philomena.Users.User
|
|
alias Philomena.Notifications.Notification
|
|
|
|
@primary_key false
|
|
|
|
schema "unread_notifications" do
|
|
belongs_to :user, User, primary_key: true
|
|
belongs_to :notification, Notification, primary_key: true
|
|
end
|
|
|
|
@doc false
|
|
def changeset(unread_notification, attrs) do
|
|
unread_notification
|
|
|> cast(attrs, [])
|
|
|> validate_required([])
|
|
end
|
|
end
|