DEV: move 'default_scope' to default sort on 'has_many' relation
This commit is contained in:
parent
c02e81fe01
commit
f7b7bc8abe
|
@ -4,7 +4,7 @@ class Poll < ActiveRecord::Base
|
|||
|
||||
belongs_to :post
|
||||
|
||||
has_many :poll_options, dependent: :destroy
|
||||
has_many :poll_options, -> { order(:id) }, dependent: :destroy
|
||||
has_many :poll_votes
|
||||
|
||||
enum type: {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
class PollOption < ActiveRecord::Base
|
||||
belongs_to :poll
|
||||
has_many :poll_votes, dependent: :delete_all
|
||||
|
||||
default_scope { order(:id) }
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
|
|
Loading…
Reference in New Issue