Module: MongoMapper::Associations::InstanceMethods

Defined in:
lib/mongo_mapper/associations.rb

Instance Method Summary collapse

Instance Method Details

#get_proxy(association) ⇒ Object



173
174
175
176
177
178
179
180
# File 'lib/mongo_mapper/associations.rb', line 173

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