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:



107
108
109
110
111
# File 'lib/mongoid/scopable.rb', line 107

def queryable
  crit = Threaded.current_scope(self) || Criteria.new(self)
  crit.embedded = true if (crit.klass.embedded? && !crit.klass.cyclic?)
  crit
end