-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
ENV["RAILS_ENV"] ||= "development" require "./config/environment" class Comment include Mongoid::Document default_scope asc(:_id) scope :pre, where(:video_timestamp => nil) scope :timestamped, where(:video_timestamp.ne => nil) end p Comment.pre.selector # => {} p Comment.unscoped.pre.selector # => {} p Comment.where(:video_timestamp => nil).selector # => {"video_timestamp"=>nil} p Comment.timestamped.selector # => {"video_timestamp"=>{"$ne"=>nil}}
It works correctly when defining some other condition in default_scope.