我有这个:
beans.xml
出于某种原因,我在bean-discovery-mode="annotated"
中收到# config/setting1.yml
var1: 11
var2: 12
# config/initializers/setting1.rb
Rails.configuration.setting1 = YAML.load_file(Rails.root.join('config', 'setting1.yml'))[Rails.env]
# config/environments/development.rb
//Doing something with Rails.configuration.setting1
// Rails.configuration.setting1['var1']
为什么?加载development.rb
后是否加载development.rb?
答案 0 :(得分:0)
在config/environments/development.rb
之后加载初始值设定项。您可以在Rails指南中查看更多内容:http://guides.rubyonrails.org/initialization.html