Merge branch 'master' into 6588-documentation
[arvados.git] / services / api / config / initializers / preload_all_models.rb
1 # See http://aaronvb.com/articles/37-rails-caching-and-undefined-class-module
2
3 # Config must be done before we load model class files; otherwise they
4 # won't be able to use Rails.configuration.* to initialize their
5 # classes.
6 require_relative 'load_config.rb'
7
8 if Rails.env == 'development'
9   Dir.foreach("#{Rails.root}/app/models") do |model_file|
10     require_dependency model_file if model_file.match /\.rb$/
11   end
12 end