This project is archived and is in readonly mode.
autosave => false should be same as not declaring autosave
Reported by Neeraj Singh | August 8th, 2010 @ 05:06 AM | in 3.x
has_many :brakes, :autosave => false
Above statement is not same as
has_many :brakes
class Car < ActiveRecord::Base
has_many :brakes, :autosave => false
def self.lab
Car.delete_all
Brake.delete_all
c = Car.create
c.brakes.build(:name => nil)
c.save
c.reload
puts c.brakes.size #=> 0
end
end
class Car < ActiveRecord::Base
has_many :brakes#, :autosave => false (notice the # earlier in the string)
def self.lab
Car.delete_all
Brake.delete_all
c = Car.create
c.brakes.build(:name => nil)
c.save
c.reload
puts c.brakes.size #=> 1
end
end
Comments and changes to this ticket
-
Neeraj Singh August 9th, 2010 @ 04:10 PM
- State changed from open to invalid
Closing this ticket. Please see #5339 for more expanded version of this ticket.
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>