在 Active Admin 中想知道如何使用 2 列设置 config.sort_order,其中第一列来自同一模型,第二列来自关联模型?
ActiveAdmin.register Race do
menu parent: :races, :label => proc{ I18n.t('activerecord.models.races') }
belongs_to :meeting, :optional => true
#need to order by "meetings.date desc races.time desc"
config.sort_order = "?"
controller do
def scoped_collection
end_of_association_chain.includes(:meeting)
end
end
end