This project is archived and is in readonly mode.
has_one natural assignment to already associated record
Reported by qoobaa | August 18th, 2008 @ 08:47 PM | in 2.x
Example from the http://www.simpltry.com/2008/07/... :
>> user = User.first
=> #<User id: 1>
>> user.email = Email.find(user.email.id)
=> #<Email id: 1, user_id: 1>
>> user.reload
=> #<User id: 1>
>> user.email
=> nil
I've spent over two hours on debugging it in my code (I used callbacks to associate objects). It's really surprising - I think it's not the obvious and expected behaviour.
Comments and changes to this ticket
-
qoobaa August 21st, 2008 @ 12:04 PM
- Tag changed from 2.1, activerecord, bug to 2.1, activerecord, bug, patch, tested
I've fixed the bug and created a simple test_has_one_natural_assignment_to_already_associated_record.
-
qoobaa August 21st, 2008 @ 12:07 PM
- Title changed from has_one unexpected behaviour to has_one natural assignment to already associated record
-
Repository August 21st, 2008 @ 03:30 PM
- State changed from new to resolved
(from [ea40f71431a821b2ddb37be6ea3ee7d8dac63b85]) Fix that has_one natural assignment to already associated record. [#854 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
-
Repository August 25th, 2008 @ 09:30 AM
(from [2242d3faf12dfc381850e2269016dd4ba95bad86]) Fix that has_one natural assignment to already associated record. [#854 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 854 has_one natural assignment to already associated record (from [ea40f71431a821b2ddb37be6ea3ee7d8dac63b85]) Fix tha...
- 854 has_one natural assignment to already associated record (from [2242d3faf12dfc381850e2269016dd4ba95bad86]) Fix tha...