1 require File.expand_path("../boot", __FILE__)
 
   3 require File.expand_path("../preinitializer", __FILE__)
 
   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     # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
 
  26     # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
 
  27     # config.time_zone = 'Central Time (US & Canada)'
 
  29     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
 
  30     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
 
  31     # config.i18n.default_locale = :de
 
  33     # Do not swallow errors in after_commit/after_rollback callbacks.
 
  34     config.active_record.raise_in_transactional_callbacks = true unless STATUS == :database_offline
 
  36     # Custom directories with classes and modules you want to be autoloadable.
 
  37     config.autoload_paths += %W(#{config.root}/lib)
 
  39     # Use SQL instead of Active Record's schema dumper when creating the database.
 
  40     # This is necessary if your schema can't be completely dumped by the schema dumper,
 
  41     # like if you have constraints or database-specific column types
 
  42     config.active_record.schema_format = :sql unless STATUS == :database_offline
 
  44     # Don't eager load models when the database is offline
 
  45     config.paths["app/models"].skip_eager_load! if STATUS == :database_offline
 
  47     # Use memcached for caching if required
 
  48     if defined?(MEMCACHE_SERVERS)
 
  49       config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" }
 
  52     # Use logstash for logging if required
 
  53     if defined?(LOGSTASH_PATH)
 
  54       config.logstasher.enabled = true
 
  55       config.logstasher.suppress_app_log = false
 
  56       config.logstasher.logger_path = LOGSTASH_PATH
 
  57       config.logstasher.log_controller_parameters = true
 
  60     # Configure image optimisation
 
  61     config.assets.image_optim = YAML.load_file("#{Rails.root}/config/image_optim.yml")