1 require_relative "boot"
3 require_relative "preinitializer"
5 if STATUS == :database_offline
6 require "action_controller/railtie"
7 require "action_mailer/railtie"
8 require "active_model/railtie"
9 require "sprockets/railtie"
10 require "rails/test_unit/railtie"
15 # Require the gems listed in Gemfile, including any gems
16 # you've limited to :test, :development, or :production.
17 Bundler.require(*Rails.groups)
20 class Application < Rails::Application
21 # Initialize configuration defaults for originally generated Rails version.
22 config.load_defaults 5.2
24 # Settings in config/environments/* take precedence over those specified here.
25 # Application configuration can go into files in config/initializers
26 # -- all .rb files in that directory are automatically loaded after loading
27 # the framework and any gems in your application.
29 # Custom directories with classes and modules you want to be autoloadable.
30 config.autoload_paths += %W[#{config.root}/lib]
32 # This defaults to true from rails 5.0 but our code doesn't comply
33 # with it at all so we turn it off
34 config.active_record.belongs_to_required_by_default = false
36 # Use SQL instead of Active Record's schema dumper when creating the database.
37 # This is necessary if your schema can't be completely dumped by the schema dumper,
38 # like if you have constraints or database-specific column types
39 config.active_record.schema_format = :sql unless STATUS == :database_offline
41 # Don't eager load models when the database is offline
42 config.paths["app/models"].skip_eager_load! if STATUS == :database_offline
44 # Use memcached for caching if required
45 config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" } if defined?(MEMCACHE_SERVERS)
47 # Use logstash for logging if required
48 if defined?(LOGSTASH_PATH)
49 config.logstasher.enabled = true
50 config.logstasher.suppress_app_log = false
51 config.logstasher.logger_path = LOGSTASH_PATH
52 config.logstasher.log_controller_parameters = true