很高兴地使用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
无法找出或找出第一行代码的反转。 我认为它应该是直截了当的:)