search for: update_models

Displaying 1 result from an estimated 1 matches for "update_models".

Did you mean: update_mode
2008 Jul 28
1
callback executed like after_save but after transaction
...cord class so that it is executed whenever an object is updated, this code is a seperate process that reads from the same table represented by my model class so when it runs it needs the database to be up to date. In the following situation this is fine: # MyModel def after_save `/usr/local/bin/update_models -i #{self.id}` end # controller action delete def delete MyModel.find(params[:id]).update_attribute(:deleted_at, Time.now) # after_save is called when the table end But in this situation: # controller action new def new MyModel.transaction do newmodel = MyModel.new othermodel = MyOth...