acts_as_follower订单追踪者降序
问题描述:
我使用的是gem acts_as_followers以使人们能够关注我网站上的其他用户。当我使用以下内容:acts_as_follower订单追踪者降序
@user.following_users
@user.user_followers
我想返回一个数组,其中包含按其日期排序的用户。现在,似乎默认排序是最早的。
答
我不知道,但你可以尝试@user.following_users.descending
或通过选择这个方法,如:@user.user_followers(order: {created_at: :desc})
感谢您的建议,但这并没有为我工作 - 我得到了同样的答复,即使我将其更改为上升 – scientiffic 2014-10-01 15:06:36