How to refresh ActiveRecord result in “rails way”? Example:
stuff = Stuff.find(:id)
a = stuff.x # a = 3
(at this time field value in database stuff.x changed to 7 )
a = stuff.x # a = 3 but I need here 7
Is it possible to do something like stuff.refresh_data to re-execute query?
You can use
reload. In your case you would writestuff.reloadHere is the documentation.