dev_forum
parent
c22ec7dff2
commit
ad092d91e1
@ -1,6 +1,6 @@
|
||||
class Repertoire < ApplicationRecord
|
||||
default_scope :order => 'updated_at desc'
|
||||
has_many :sub_repertoires, :dependent => :destroy, :order => "sub_repertoires.updated_at desc"
|
||||
has_many :sub_repertoires, ->{order("sub_repertoires.updated_at desc")}, :dependent => :destroy
|
||||
|
||||
has_many :tag_repertoires, through: :sub_repertoires
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
class SubRepertoire < ApplicationRecord
|
||||
belongs_to :repertoire
|
||||
has_many :tag_repertoires, :dependent => :destroy, :order => "tag_repertoires.updated_at desc"
|
||||
has_many :tag_repertoires, ->{order("tag_repertoires.updated_at desc")} ,:dependent => :destroy
|
||||
|
||||
end
|
||||
|
Loading…
Reference in new issue