Module: CouchFoo::Associations

Defined in:
lib/couch_foo/associations.rb,
lib/couch_foo/associations/association_proxy.rb,
lib/couch_foo/associations/has_one_association.rb,
lib/couch_foo/associations/has_many_association.rb,
lib/couch_foo/associations/association_collection.rb,
lib/couch_foo/associations/belongs_to_association.rb,
lib/couch_foo/associations/belongs_to_polymorphic_association.rb,
lib/couch_foo/associations/has_and_belongs_to_many_association.rb

Overview

:nodoc:

Defined Under Namespace

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



77
78
79
# File 'lib/couch_foo/associations.rb', line 77

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#clear_association_cacheObject

Clears out the association cache



82
83
84
85
86
# File 'lib/couch_foo/associations.rb', line 82

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