Module: MongoMapper::Associations::InstanceMethods

Defined in:
lib/mongomapper/associations.rb

Instance Method Summary collapse

Instance Method Details

#get_proxy(association) ⇒ Object



76
77
78
79
80
81
82
83
# File 'lib/mongomapper/associations.rb', line 76

def get_proxy(association)
  unless proxy = self.instance_variable_get(association.ivar)
    proxy = association.proxy_class.new(self, association)
    self.instance_variable_set(association.ivar, proxy) if !frozen?
  end

  proxy
end