很高兴地使用Mongoid
和ActiveRecord
,如下所示:
Task.where(project_id: params[:project_id], archived_at: nil)
# find me the tasks for project_id that haven't been archived
但是如何简明地表示相反的意思呢?
# find me the tasks for project_id that have been archived
# i.e. where archived_at is not nil
无法理解或找到第一行代码的逆运算。
我认为这应该很简单 :)