Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objects to be embedded getting saved to the database #10

Open
SFEley opened this issue May 9, 2010 · 0 comments
Open

Objects to be embedded getting saved to the database #10

SFEley opened this issue May 9, 2010 · 0 comments

Comments

@SFEley
Copy link
Owner

SFEley commented May 9, 2010

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant