lib/mongoid/association/accessors.rb
# Resets the criteria inside the association proxy. Used by many-to-many
# associations to keep the underlying ids array in sync.
#
# @example Reset the association criteria.
#   person.reset_relation_criteria(:preferences)
#
# @param [ Symbol ] name The name of the association.
Resets the criteria inside the association proxy. Used by many-to-many
associations to keep the underlying ids array in sync.
Resets the criteria inside the association proxy . Used by many - to - many associations to keep the underlying ids array in sync .
def reset_relation_criteria(name)
        if instance_variable_defined?("@_#{name}")
          send(name).reset_unloaded
        end
      end
def reset_relation_criteria ( name ) if instance_variable_defined? ( "@_#{name}" ) send ( name ) . reset_unloaded end end
Resets the criteria inside the association proxy.
Resets the criteria inside the association proxy .
name
<not_specific>
<not_specific>
name The name of the association.
name The name of the association .
example
Reset the association criteria. person.reset_relation_criteria(:preferences)
Reset the association criteria . person . reset_relation_criteria ( : preferences )