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_resource/railtie"
 
   9 require "sprockets/railtie"
 
  10 require "rails/test_unit/railtie"
 
  16   # If you precompile assets before deploying to production, use this line
 
  17   Bundler.require(*Rails.groups(:assets => %w(development test)))
 
  18   # If you want your assets lazily compiled in production, use this line
 
  19   # Bundler.require(:default, :assets, Rails.env)
 
  23   class Application < Rails::Application
 
  24     # Settings in config/environments/* take precedence over those specified here.
 
  25     # Application configuration should go into files in config/initializers
 
  26     # -- all .rb files in that directory are automatically loaded.
 
  28     # Custom directories with classes and modules you want to be autoloadable.
 
  29     config.autoload_paths += %W(#{config.root}/lib)
 
  31     # Only load the plugins named here, in the order given (default is alphabetical).
 
  32     # :all can be used as a placeholder for all plugins not explicitly named.
 
  33     # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
 
  35     # Activate observers that should always be running.
 
  36     unless STATUS == :database_offline
 
  37       config.active_record.observers = :spam_observer
 
  40     # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
 
  41     # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
 
  42     # config.time_zone = 'Central Time (US & Canada)'
 
  44     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
 
  45     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
 
  46     # config.i18n.default_locale = :de
 
  48     # Configure the default encoding used in templates for Ruby 1.9.
 
  49     config.encoding = "utf-8"
 
  51     # Configure sensitive parameters which will be filtered from the log file.
 
  52     config.filter_parameters += [:password, :pass_crypt, :pass_crypt_confirmation]
 
  54     # Use SQL instead of Active Record's schema dumper when creating the database.
 
  55     # This is necessary if your schema can't be completely dumped by the schema dumper,
 
  56     # like if you have constraints or database-specific column types
 
  57     unless STATUS == :database_offline
 
  58       config.active_record.schema_format = :sql
 
  61     # Enforce whitelist mode for mass assignment.
 
  62     # This will create an empty whitelist of attributes available for mass-assignment for all models
 
  63     # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
 
  64     # parameters by using an attr_accessible or attr_protected declaration.
 
  65     unless STATUS == :database_offline
 
  66       config.active_record.whitelist_attributes = true
 
  69     # Enable the asset pipeline
 
  70     config.assets.enabled = true
 
  72     # Version of your assets, change this if you want to expire all your assets
 
  73     config.assets.version = '1.0'
 
  75     # Don't eager load models when the database is offline
 
  76     if STATUS == :database_offline
 
  77       config.paths["app/models"].skip_eager_load!