我有一个复杂的范围,我正在获取一份清单。在这个清单中有一堆不同类别下的任务。我只想要完整的清单,但有些清单将是完整的,而不是每个类别都完成。因此,在检查列中是否包含任何内容之前,我需要能够检查是否需要每一列。这是我的例子。
scope :complete, lambda {|check_lists| check_lists.map do |check_list|
not_complete = false
if check_list.event.booking.video_for_event?
if check_list.raw_footage_user_id.blank? && check_list.raw_footage_check.blank? then not_complete = true end
end
if check_list.event.booking.eblast_not_blank?
# more checking...
end
if check_list.event.booking.on_site_not_blank?
# more checking...
end
if not_complete then reject end
end } #If videos, verify video items. if eblasts, verify eblast items, etc...
所以基本上我需要知道如何通过从正在映射的数组中删除 non_complete 对象来完成它。