Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

autosave => false should be same as not declaring autosave

#5334
  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

Reported by Neeraj Singh · August 8th, 2010 @ 05:06 AM

State: invalid
Milestone: 3.x
Assigned to: Neeraj Singh Neeraj Singh
Importance: Low

Activity

  1. Neeraj Singh
    Neeraj Singh
    • State changed from open to invalid

    Closing this ticket. Please see #5339 autosave behavior not consistent between has_many and has_one for more expanded version of this ticket.

    August 9th, 2010 @ 04:10 PM