This project is archived and is in readonly mode.
Explicit autosave => false should override new_record autosaving
Reported by Jacob Burkhart | March 11th, 2009 @ 04:25 PM | in 2.3.6
previously mentioned in #2144
"autosave" as a feature in rails 2.3 provides the ability to configure a particular model to automatically save the other end of a particular relationship on save.
This behavior existed in earlier version of rails, and would be triggered automatically when a model was saved and it had a relationship to another which was a "new_record?"
Since autosave => true is now a way to make this saving happen for cases beyond new_record:
Here is a patch which makes autosave => false a way to make autosave never happen, including skipping saving of "new_record?" associations.
Comments and changes to this ticket
-
Jacob Burkhart March 11th, 2009 @ 04:31 PM
- no changes were found...
-
Eloy Duran March 18th, 2009 @ 07:07 PM
I will wok on this, but there are some other things I need to finish first. But it will be added :)
Thanks
-
Eloy Duran July 11th, 2009 @ 04:25 PM
Hey Jacob,
I've verified your patch and have it in the queue to be applied, however, could you supply me with your full name and email so I can set the right author?
Thanks
-
Eloy Duran July 12th, 2009 @ 12:42 PM
- State changed from new to verified
- Milestone changed from 2.x to 2.3.4
I have verified and applied this patch on my branch of 2-3-stable, which Micheal will look at and merge in before 2.3.4.
http://github.com/alloy/rails/commit/295a20b2e9c0dfe7d70e4521333e5f...
Thanks!
-
Jeremy Kemper September 11th, 2009 @ 11:04 PM
- Milestone changed from 2.3.4 to 2.3.6
[milestone:id#50064 bulk edit command]
-
Repository September 13th, 2009 @ 02:33 AM
- State changed from verified to resolved
(from [2420d6272c8dfa1ebd6735fc9b29e73291b0b93c]) Explicitely setting
autosave => false' should override new_record autosaving. [[#2214](/projects/8994/tickets/2214 "Ticket #2214") state:resolved]
Original author is Jacob.
http://github.com/rails/rails/commit/2420d6272c8dfa1ebd6735fc9b29e7... -
Repository September 13th, 2009 @ 02:33 AM
(from [6cc0b9638fbb6ede3c46b51d7dab17881416014c]) Explicitely setting
autosave => false' should override new_record autosaving. [[#2214](/projects/8994/tickets/2214 "Ticket #2214") state:resolved]
Original author is Jacob.
http://github.com/rails/rails/commit/6cc0b9638fbb6ede3c46b51d7dab17... -
Michael Johnston August 5th, 2010 @ 11:43 PM
- Importance changed from to Low
The way this was implemented means that when autosave is false on a belongs_to association and you do save an association (that is a new record) manually, the foreign key does not get set in the record owning the association.https://rails.lighthouseapp.com/preview
Was this intentional? It kind of seems to me that the foreign keys should still get set.
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
- 2144 Don't autosave new_record associations Patch for new_record when autosave => false in #2214