Is it possible to send variables in the the transition? i.e.
@car.crash!(:crashed_by => current_user)
I have callbacks in my model but I nee
I used transactions, instead of updating the object and changing the state in one call. For example, in update action,
ActiveRecord::Base.transaction do
if @car.update_attribute!(:crashed_by => current_user)
if @car.crash!()
format.html { redirect_to @car }
else
raise ActiveRecord::Rollback
else
raise ActiveRecord::Rollback
end
end