mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 23:08:00 +01:00
23 lines
469 B
Elixir
23 lines
469 B
Elixir
defmodule Philomena.PollVotes.PollVote do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
alias Philomena.PollOptions.PollOption
|
|
alias Philomena.Users.User
|
|
|
|
schema "poll_votes" do
|
|
belongs_to :poll_option, PollOption
|
|
belongs_to :user, User
|
|
|
|
field :rank, :integer
|
|
|
|
timestamps(inserted_at: :created_at, updated_at: false)
|
|
end
|
|
|
|
@doc false
|
|
def changeset(poll_vote, attrs) do
|
|
poll_vote
|
|
|> cast(attrs, [])
|
|
|> validate_required([])
|
|
end
|
|
end
|