]> git.openstreetmap.org Git - rails.git/blob - config/application.rb
Merge remote-tracking branch 'upstream/pull/4308'
[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     # Please, add to the `ignore` list any other `lib` subdirectories that do
15     # not contain `.rb` files, or that should not be reloaded or eager loaded.
16     # Common ones are `templates`, `generators`, or `middleware`, for example.
17     config.autoload_lib(:ignore => %w[assets classic_pagination tasks])
18
19     # Configuration for the application, engines, and railties goes here.
20     #
21     # These settings can be overridden in specific environments using the files
22     # in config/environments, which are processed later.
23     #
24     # config.time_zone = "Central Time (US & Canada)"
25     # config.eager_load_paths << Rails.root.join("extras")
26
27     # Use SQL instead of Active Record's schema dumper when creating the database.
28     # This is necessary if your schema can't be completely dumped by the schema dumper,
29     # like if you have constraints or database-specific column types
30     config.active_record.schema_format = :sql unless Settings.status == "database_offline"
31
32     # Use rails 7.1 cache format
33     config.active_support.cache_format_version = 7.1
34
35     # Use memcached for caching if required
36     config.cache_store = :mem_cache_store, Settings.memcache_servers, { :namespace => "rails:cache" } if Settings.key?(:memcache_servers)
37
38     # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
39     # the I18n.default_locale when a translation cannot be found).
40     config.i18n.fallbacks = true
41
42     # Use logstash for logging if required
43     if Settings.key?(:logstash_path)
44       config.logstasher.enabled = true
45       config.logstasher.suppress_app_log = false
46       config.logstasher.logger_path = Settings.logstash_path
47       config.logstasher.log_controller_parameters = true
48     end
49   end
50 end