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 should go into files in config/initializers
23 # -- all .rb files in that directory are automatically loaded.
25 # Custom directories with classes and modules you want to be autoloadable.
26 config.autoload_paths += %W[#{config.root}/lib]
28 # Use SQL instead of Active Record's schema dumper when creating the database.
29 # This is necessary if your schema can't be completely dumped by the schema dumper,
30 # like if you have constraints or database-specific column types
31 config.active_record.schema_format = :sql unless STATUS == :database_offline
33 # Don't eager load models when the database is offline
34 config.paths["app/models"].skip_eager_load! if STATUS == :database_offline
36 # Use memcached for caching if required
37 if defined?(MEMCACHE_SERVERS)
38 config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" }
41 # Use logstash for logging if required
42 if defined?(LOGSTASH_PATH)
43 config.logstasher.enabled = true
44 config.logstasher.suppress_app_log = false
45 config.logstasher.logger_path = LOGSTASH_PATH
46 config.logstasher.log_controller_parameters = true
49 # Configure image optimisation
50 config.assets.image_optim = YAML.load_file(Rails.root.join("config", "image_optim.yml"))