How can I load multiple YAML files in rails application.rb

Viewed 2254

I have many yaml files in config/ And I want to load all yaml files.

EX: I have two .yml files name is: application.yml and linkedin.yml. I want to load both files with application.rb.

To achieve this goal I Have written code in application.rb:

ENV.update YAML.load_file('config/application.yml')[Rails.env] rescue {}
ENV.update YAML.load_file('config/linkedin.yml')[Rails.env] rescue {}

But this is not appropriate way, Please suggest me how can I load all yaml files access with ENV variable that.

1 Answers
Related