]> git.openstreetmap.org Git - rails.git/blob - config/application.rb
Allow models to load when the database is offline
[rails.git] / config / application.rb
1 require_relative "boot"
2
3 require "rails/all"
4
5 # Require the gems listed in Gemfile, including any gems
6 # you've limited to :test, :development, or :production.
7 Bundler.require(*Rails.groups)
8
9 module OpenStreetMap
10   class Application < Rails::Application
11     # Initialize configuration defaults for originally generated Rails version.
12     config.load_defaults 7.0
13
14     # Settings in config/environments/* take precedence over those specified here.
15     # Application configuration can go into files in config/initializers
16     # -- all .rb files in that directory are automatically loaded after loading
17     # the framework and any gems in your application.
18
19     # Custom directories with classes and modules you want to be autoloadable.
20     config.autoload_paths += %W[#{config.root}/lib]
21
22     # Force requests from old versions of IE (<= IE8) to be UTF-8 encoded.
23     # This has defaulted to false since rails 6.0
24     config.action_view.default_enforce_utf8 = true
25
26     # Use SQL instead of Active Record's schema dumper when creating the database.
27     # This is necessary if your schema can't be completely dumped by the schema dumper,
28     # like if you have constraints or database-specific column types
29     config.active_record.schema_format = :sql unless Settings.status == "database_offline"
30
31     # Use memcached for caching if required
32     config.cache_store = :mem_cache_store, Settings.memcache_servers, { :namespace => "rails:cache" } if Settings.key?(:memcache_servers)
33
34     # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
35     # the I18n.default_locale when a translation cannot be found).
36     config.i18n.fallbacks = true
37
38     # Use logstash for logging if required
39     if Settings.key?(:logstash_path)
40       config.logstasher.enabled = true
41       config.logstasher.suppress_app_log = false
42       config.logstasher.logger_path = Settings.logstash_path
43       config.logstasher.log_controller_parameters = true
44     end
45   end
46 end