Sha256: d684a1849bade853d6a6410a3f7db85c5a59dc8abd57399607d56eb9e02dc207
Contents?: true
Size: 531 Bytes
Versions: 22
Compression:
Stored size: 531 Bytes
Contents
module MongoMapper module Plugins module Associations class BelongsToProxy < Proxy undef_method :object_id def replace(doc) if doc doc.save if doc.new? id = doc.id end owner[reflection.foreign_key] = id reset end protected def find_target return nil if owner[reflection.foreign_key].nil? klass.find_by_id(owner[reflection.foreign_key]) end end end end end
Version data entries
22 entries across 22 versions & 3 rubygems