lib/mongomapper/associations/belongs_to_proxy.rb in jnunemaker-mongomapper-0.3.2 vs lib/mongomapper/associations/belongs_to_proxy.rb in jnunemaker-mongomapper-0.3.3

- old
+ new

@@ -4,18 +4,18 @@ def replace(doc) if doc doc.save if doc.new? id = doc.id end - + @owner.send("#{@association.belongs_to_key_name}=", id) reset end protected def find_target if association_id = @owner.send(@association.belongs_to_key_name) - @association.klass.find(association_id) + @association.klass.find_by_id(association_id) end end end end end