Method: Mongoid::Scopable::ClassMethods#queryable

Defined in:
lib/mongoid/scopable.rb

#queryableCriteria

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get a queryable, either the last one on the scope stack or a fresh one.

Examples:

Get a queryable.

Model.queryable

Returns:

Since:

  • 3.0.0



117
118
119
# File 'lib/mongoid/scopable.rb', line 117

def queryable
  Threaded.current_scope(self) || Criteria.new(self)
end