This project is archived and is in readonly mode.
Find on nested models does not trigger callbacks
-
Neeraj Singh
- Importance changed from to Low
Not sure what you mean by NestedModel since I did not see any NestedModel in the example you illustrated.
Following code works for me with rails edge.
class Car < ActiveRecord::Base has_many :brakes end class Brake < ActiveRecord::Base belongs_to :car after_update :foo def foo puts 'foo'*50 end def self.lab Car.create(:name => 'honda') unless Car.first Car.first.brakes.create(:name => 'b1') unless Brake.first b = Brake.find(1) b.update_attributes({:name => 'b2'}) b = Car.first.brakes.find(1) b.update_attributes({:name => 'b3'}) b = Brake.find_by_id_and_name(1, 'b3') b.update_attributes({:name => 'b4'}) end end -
Matthias Kühnert
OK, I have just found this error does not occur when I use "rails server", but when I use passenger 3.0.0. Sorry, these are not nested models but simple has_many relations.
-
Neeraj Singh
- State changed from new to resolved