Sha256: d41cacee662017b136faa32cb2695522b3f8dfab66829ceba9a57596e7366e8b
Contents?: true
Size: 470 Bytes
Versions: 11
Compression:
Stored size: 470 Bytes
Contents
module MongoMapper module Associations class BelongsToProxy < Proxy def replace(doc) if doc doc.save if doc.new? id = doc._id end @owner.send("#{@association.foreign_key}=", id) reset end protected def find_target if association_id = @owner.send(@association.foreign_key) @association.klass.find_by_id(association_id) end end end end end
Version data entries
11 entries across 11 versions & 4 rubygems