访问被拒绝,你可能没有权限或未登录。

新手问题 Mongoid has_many sort

tanjianna · September 24, 2012 · Last by rainlife replied at September 26, 2012 · 2613 hits

例如我有两张表:

brands 和 devices brand has_many devices devices belongs_to brand

我现在想 Brand.find(params[:id]) 遍历 Brand 和 Devices 并且 Devices List 需要根据 create_time 来排序!我该如何做好?

default_scope ?

You need to Sign in before reply, if you don't have an account, please Sign up first.