Rails force models to eager load

后端 未结 4 1380
我寻月下人不归
我寻月下人不归 2020-12-30 22:30

I would like to be able to load an entire app so that I may find the descendants of a given class.

For example given I have the following class defined:



        
4条回答
  •  一生所求
    2020-12-30 22:50

    Well, after some digging, it actually is really simple. Just need to run the following.

    Rails.application.eager_load!
    

提交回复
热议问题