We are happy to use Mongoidit ActiveRecordas follows:
Task.where(project_id: params[:project_id], archived_at: nil)
But what is the easiest way to say the opposite?
# find me the tasks for project_id that have been archived
# i.e. where archived_at is not nil
It is impossible to figure out or find out the reverse line of the first line of code. I guess it should be simple :)
source
share