首页筛选问题

dev_forum
daiao 5 years ago
parent 2c6e5fd93f
commit c22ec7dff2

@ -1,6 +1,6 @@
class Repertoire < ApplicationRecord class Repertoire < ApplicationRecord
default_scope :order => 'updated_at desc'
has_many :sub_repertoires has_many :sub_repertoires, :dependent => :destroy, :order => "sub_repertoires.updated_at desc"
has_many :tag_repertoires, through: :sub_repertoires has_many :tag_repertoires, through: :sub_repertoires
end end

@ -1,3 +1,5 @@
class SubRepertoire < ApplicationRecord class SubRepertoire < ApplicationRecord
has_many :tag_repertoires belongs_to :repertoire
has_many :tag_repertoires, :dependent => :destroy, :order => "tag_repertoires.updated_at desc"
end end

Loading…
Cancel
Save