Sha256: fabe640920704f535dd378aacfd45d00acd580126b341a2660af5c528728d940
Contents?: true
Size: 485 Bytes
Versions: 16
Compression:
Stored size: 485 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
16 entries across 16 versions & 4 rubygems