When and where do I require files in a rails application?

前端 未结 5 1667
半阙折子戏
半阙折子戏 2021-02-03 22:00

Let\'s say I have I have the following file in my lib directory of my rails application:

#lib/proxy.rb
module SomeService
  class ServiceProxy
    def do_somethi         


        
5条回答
  •  终归单人心
    2021-02-03 22:43

    Have you tried removing it from the first model as well? I believe Rails will automatically load any files you have in your lib directory without you ever having to require them explicitly.

提交回复
热议问题