]> git.openstreetmap.org Git - rails.git/blob - config/application.rb
Update query icon to display cursor with '?'
[rails.git] / config / application.rb
1 require_relative "boot"
2
3 require_relative "preinitializer"
4
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"
11 else
12   require "rails/all"
13 end
14
15 # Require the gems listed in Gemfile, including any gems
16 # you've limited to :test, :development, or :production.
17 Bundler.require(*Rails.groups)
18
19 module OpenStreetMap
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.
24
25     # Custom directories with classes and modules you want to be autoloadable.
26     config.autoload_paths += %W[#{config.root}/lib]
27
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
32
33     # Don't eager load models when the database is offline
34     config.paths["app/models"].skip_eager_load! if STATUS == :database_offline
35
36     # Use memcached for caching if required
37     config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" } if defined?(MEMCACHE_SERVERS)
38
39     # Use logstash for logging if required
40     if defined?(LOGSTASH_PATH)
41       config.logstasher.enabled = true
42       config.logstasher.suppress_app_log = false
43       config.logstasher.logger_path = LOGSTASH_PATH
44       config.logstasher.log_controller_parameters = true
45     end
46
47     # Configure image optimisation
48     config.assets.image_optim = YAML.load_file(Rails.root.join("config", "image_optim.yml"))
49   end
50 end