My model doesn't seem to be updated correctly.
- Unicorn rainbows! on EventMachine
- mysql2 gem
I can reproduce in the production
environment with 1000 rpm on 8 workers. If I update my_model
in the Rails console (with a call to reload!
), all works fine. Locally I can't reproduce it.
From the controller:
# params[:my_model] = {:name => "new name"}
def update
@my_model = MyModel.first # {:name => "old name"}
Rails.logger.info @my_model.name
@my_model.update_attributes(params[:my_model])
redirect_to :action => :index
end
Log:
new name
old name
old name
old name
new name
What do I wrong? Thanks for advance!