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 # Settings in config/environments/* take precedence over those specified here.
22 # Application configuration can go into files in config/initializers
23 # -- all .rb files in that directory are automatically loaded after loading
24 # the framework and any gems in your application.
26 # Custom directories with classes and modules you want to be autoloadable.
27 config.autoload_paths += %W[#{config.root}/lib]
29 # Use SQL instead of Active Record's schema dumper when creating the database.
30 # This is necessary if your schema can't be completely dumped by the schema dumper,
31 # like if you have constraints or database-specific column types
32 config.active_record.schema_format = :sql unless STATUS == :database_offline
34 # Don't eager load models when the database is offline
35 config.paths["app/models"].skip_eager_load! if STATUS == :database_offline
37 # Use memcached for caching if required
38 config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" } if defined?(MEMCACHE_SERVERS)
40 # Use logstash for logging if required
41 if defined?(LOGSTASH_PATH)
42 config.logstasher.enabled = true
43 config.logstasher.suppress_app_log = false
44 config.logstasher.logger_path = LOGSTASH_PATH
45 config.logstasher.log_controller_parameters = true