Module: ActiveRecord::Associations

Extended by:
ActiveSupport::Concern
Defined in:
activerecord/lib/active_record/associations.rb,
activerecord/lib/active_record/associations/association_proxy.rb,
activerecord/lib/active_record/associations/has_one_association.rb,
activerecord/lib/active_record/associations/has_many_association.rb,
activerecord/lib/active_record/associations/belongs_to_association.rb,
activerecord/lib/active_record/associations/association_collection.rb,
activerecord/lib/active_record/associations/through_association_scope.rb,
activerecord/lib/active_record/associations/has_one_through_association.rb,
activerecord/lib/active_record/associations/has_many_through_association.rb,
activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb,
activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb

Overview

Active Record Has And Belongs To Many Association

Defined Under Namespace

Modules: ClassMethods, ThroughAssociationScope Classes: AssociationCollection, AssociationProxy, BelongsToAssociation, BelongsToPolymorphicAssociation, HasAndBelongsToManyAssociation, HasManyAssociation, HasManyThroughAssociation, HasOneAssociation, HasOneThroughAssociation

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

append_features, extended, included

Instance Method Details

#clear_association_cacheObject

Clears out the association cache.



118
119
120
121
122
# File 'activerecord/lib/active_record/associations.rb', line 118

def clear_association_cache #:nodoc:
  self.class.reflect_on_all_associations.to_a.each do |assoc|
    instance_variable_set "@#{assoc.name}", nil
  end unless self.new_record?
end