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

前端 未结 5 1630
半阙折子戏
半阙折子戏 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:44

    I would generally place that require statement in a config/initalizer file, e.g. config/initializers/load_proxy.rb

提交回复
热议问题