]> git.openstreetmap.org Git - rails.git/blob - config/application.rb
Merge pull request #6394 from openstreetmap/dependabot/github_actions/ruby/setup...
[rails.git] / config / application.rb
1 # frozen_string_literal: true
2
3 require_relative "boot"
4
5 require "rails/all"
6
7 # Require the gems listed in Gemfile, including any gems
8 # you've limited to :test, :development, or :production.
9 Bundler.require(*Rails.groups)
10
11 module OpenStreetMap
12   class Application < Rails::Application
13     # Initialize configuration defaults for originally generated Rails version.
14     config.load_defaults 8.0
15
16     # Please, add to the `ignore` list any other `lib` subdirectories that do
17     # not contain `.rb` files, or that should not be reloaded or eager loaded.
18     # Common ones are `templates`, `generators`, or `middleware`, for example.
19     config.autoload_lib(:ignore => %w[assets tasks])
20
21     # Configuration for the application, engines, and railties goes here.
22     #
23     # These settings can be overridden in specific environments using the files
24     # in config/environments, which are processed later.
25     #
26     # config.time_zone = "Central Time (US & Canada)"
27     # config.eager_load_paths << Rails.root.join("extras")
28
29     # Use SQL instead of Active Record's schema dumper when creating the database.
30     # This is necessary if your schema can't be completely dumped by the schema dumper,
31     # like if you have constraints or database-specific column types
32     config.active_record.schema_format = :sql unless Settings.status == "database_offline"
33
34     # Use memcached for caching if required
35     config.cache_store = :mem_cache_store, Settings.memcache_servers, { :namespace => "rails:cache" } if Settings.key?(:memcache_servers)
36
37     # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
38     # the I18n.default_locale when a translation cannot be found).
39     config.i18n.fallbacks = true
40     # Enables custom error message formats
41     config.active_model.i18n_customize_full_message = true
42
43     # Use logstash for logging if required
44     if Settings.key?(:logstash_path)
45       config.logstasher.enabled = true
46       config.logstasher.suppress_app_log = false
47       config.logstasher.logger_path = Settings.logstash_path
48       config.logstasher.log_controller_parameters = true
49     end
50   end
51 end