Skip to content

Commit 10a5392

Browse files
authored
Set PollOpt preload order (#187)
1 parent 5853bc3 commit 10a5392

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/claper/polls/poll.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ defmodule Claper.Polls.Poll do
2727
field :show_results, :boolean
2828

2929
belongs_to :presentation_file, Claper.Presentations.PresentationFile
30-
has_many :poll_opts, Claper.Polls.PollOpt, on_replace: :delete
30+
31+
has_many :poll_opts, Claper.Polls.PollOpt,
32+
preload_order: [asc: :id],
33+
on_replace: :delete
34+
3135
has_many :poll_votes, Claper.Polls.PollVote, on_replace: :delete
3236

3337
timestamps()

0 commit comments

Comments
 (0)