Method: Mongoid::Relations::Referenced::ManyToMany#unscoped

Defined in:
lib/mongoid/relations/referenced/many_to_many.rb

#unscopedCriteria

Get a criteria for the documents without the default scoping applied.

Examples:

Get the unscoped criteria.

person.preferences.unscoped

Returns:

Since:

  • 2.4.0



201
202
203
# File 'lib/mongoid/relations/referenced/many_to_many.rb', line 201

def unscoped
  klass.unscoped.any_in(_id: base.send(foreign_key))
end