我已经连接了两个查询结果并希望根据特定条件限制结果。Rails级联查询结果“其中”
def all_notifications
return (user_project_notifications+followed_comments).sort_by(&:created_at).reverse
end
我想通过限制那些all_notifications一定时间后到来,所以像:
def new_notifications(notifications_last_viewed)
return all_notifications.where('created_at >?, notifications_last_viewed)
end
但是,我得到Array的错误未定义的方法',其中” :...
如何在连接结果上执行“where”查询?
好的,我明白了。现在要弄清楚如何从activerecord查询获得followed_comments ... – scientiffic