How do I change the load order of initializers in Rails 3?

前端 未结 4 1782
名媛妹妹
名媛妹妹 2020-12-24 10:43

I have an initializer that loads configuration settings from a yaml file. I need to use these settings in other initializers. The settings are not being seen by the initiali

4条回答
  •  情深已故
    2020-12-24 10:55

    Use a require_relative to make sure one file is loaded first.

    # aaa.rb
    require_relative 'bbb'
    # ... code using values from bbb.rb ...
    

提交回复
热议问题