Rails Concatenated Query Result "where"
I have concatenated two query results and would like to limit the results
based on a particular criteria.
def all_notifications
return
(user_project_notifications+followed_comments).sort_by(&:created_at).reverse
end
I'd like to limit all_notifications by those that come after a certain
time, so something like:
def new_notifications(notifications_last_viewed)
return all_notifications.where('created_at >?, notifications_last_viewed)
end
However, I'm getting the error undefined method `where' for Array:...
How can I perform a "where" query on a concatenated result?
No comments:
Post a Comment