class SubRepertoire < ApplicationRecord belongs_to :repertoire has_many :tag_repertoires, ->{order("tag_repertoires.updated_at desc")} ,:dependent => :destroy end