[Rails] why callback does not work

2011-08-16 Thread Angelo Cordova
Hello everyone I have this model class DetailPurchase ActiveRecord::Base belongs_to :purchase, :foreign_key = 'purchase_id' belongs_to :product, :foreign_key = 'product_id' belongs_to :buy_order_detail, :foreign_key = 'buy_detail_id' def before_create Storage.create!(:product_id =

Re: [Rails] why callback does not work

2011-08-16 Thread Colin Law
On 16 August 2011 17:40, Angelo Cordova acord...@gmail.com wrote: Hello everyone I have this model class DetailPurchase ActiveRecord::Base  belongs_to :purchase, :foreign_key = 'purchase_id'  belongs_to :product, :foreign_key = 'product_id'  belongs_to :buy_order_detail, :foreign_key =

Re: [Rails] why callback does not work

2011-08-16 Thread Tom Meinlschmidt
you missed definition of that callback class MyModel ActiveRecord::Base before_create :do_my_action def do_my_action …. end end tom On Aug 16, 2011, at 22:39 , Angelo Cordova wrote: The callback is not working. When I call to Storage.create! it should create a new Storage, but

Re: [Rails] why callback does not work

2011-08-16 Thread Colin Law
On 16 August 2011 21:50, Tom Meinlschmidt to...@meinlschmidt.com wrote: you missed definition of that callback class MyModel ActiveRecord::Base  before_create :do_my_action That can't be the problem because it used to work and the only change the OP made was to use jQuery instead of