Sha256: 38746f9436c2f48ea79e5f525df3ec2e48af918b157f8a3c49b808f065d3b3a2
Contents?: true
Size: 469 Bytes
Versions: 39
Compression:
Stored size: 469 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
39 entries across 39 versions & 6 rubygems