candy
candy copied to clipboard
Objects to be embedded getting saved to the database
Doing this:
u = User.new
p = Payment.embed
p.date = Time.now
p.amount = 5.00
u.payment = p
...results in a Payment collection being made and the Payment record going into it, where it will hang around as a duplicate of the one the User has.
This is not right, and it's what the .embed method was supposed to be for. Make sure initializing with that method never saves anything to the DB.