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