Jon*_*nas 13 activerecord ruby-on-rails
如何以"rails方式"刷新ActiveRecord结果?例:
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
Run Code Online (Sandbox Code Playgroud)
是否有可能像stuff.refresh_data那样重新执行查询?
| 归档时间: |
|
| 查看次数: |
6343 次 |
| 最近记录: |