Rails Console: reload! not reflecting changes in model files? What could be possible reason?

后端 未结 2 474
天涯浪人
天涯浪人 2020-11-30 01:39

Earlier it was working fine. I have been playing little bit config. So may be i have changed some config unknowingly.

here is config of environment/development.rb

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 02:11

    Are you reloading the object from the database?

    For example:

    >> a = User.last
    => #
    >> reload!
    Reloading...
    => true
    

    'a' won't reflect any changes to your model until you reload it from the db.

提交回复
热议问题