0
在我的Rails应用程序中,我有团队和员工,其中的员工是团队成员。两个对象都有序号,我想按升序排序。Rails排序子对象
我该怎么做?我想:
@teams = Team.all.order('"teams"."ordinal" asc, "staffs"."ordinal" asc')
但它没有工作......并给我的错误:
SQLite3::SQLException: no such column: staffs.ordinal: SELECT "teams".* FROM "teams" ORDER BY "teams"."ordinal" asc, "staffs"."ordinal" asc
完美!谢谢。 – Cameron