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