mongomodel icon indicating copy to clipboard operation
mongomodel copied to clipboard

How to use 'OR' within a scope

Open ghost opened this issue 10 years ago • 0 comments

How would I go about using mongo's $or functionality within mongomodel? I have two scopes that I need to merge as an OR.

scope :expires_in_future, -> { where({:expires_at.gte => Time.now}) } scope :expires_null, -> { where({:expires_at => :nil }) }

thanks

ghost avatar Aug 10 '15 14:08 ghost