mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-01 11:56:43 +01:00
26 lines
519 B
Elixir
26 lines
519 B
Elixir
defmodule Philomena.ModNotes.ModNote do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
alias Philomena.Users.User
|
|
|
|
schema "mod_notes" do
|
|
belongs_to :moderator, User
|
|
|
|
# fixme: rails polymorphic relation
|
|
field :notable_id, :integer
|
|
field :notable_type, :string
|
|
|
|
field :body, :string
|
|
field :deleted, :boolean, default: false
|
|
|
|
timestamps(inserted_at: :created_at)
|
|
end
|
|
|
|
@doc false
|
|
def changeset(mod_note, attrs) do
|
|
mod_note
|
|
|> cast(attrs, [])
|
|
|> validate_required([])
|
|
end
|
|
end
|