Merge branch '8784-dir-listings'
[arvados.git] / services / api / config / initializers / preload_all_models.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 # See http://aaronvb.com/articles/37-rails-caching-and-undefined-class-module
6
7 # Config must be done before we load model class files; otherwise they
8 # won't be able to use Rails.configuration.* to initialize their
9 # classes.
10 require_relative 'load_config.rb'
11
12 if Rails.env == 'development'
13   Dir.foreach("#{Rails.root}/app/models") do |model_file|
14     require_dependency model_file if model_file.match(/\.rb$/)
15   end
16 end