20259: Add documentation for banner and tooltip features
[arvados.git] / apps / workbench / config / application.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require_relative 'boot'
6
7 require "rails"
8 # Pick only the frameworks we need:
9 require "active_model/railtie"
10 require "active_job/railtie"
11 require "active_record/railtie"
12 # Skip ActiveStorage (new in Rails 5.1)
13 # require "active_storage/engine"
14 require "action_controller/railtie"
15 require "action_mailer/railtie"
16 require "action_view/railtie"
17 # Skip ActionCable (new in Rails 5.0) as it adds '/cable' routes that we're not using
18 # require "action_cable/engine"
19 require "sprockets/railtie"
20 require "rails/test_unit/railtie"
21
22 Bundler.require(:default, Rails.env)
23
24 if ENV["ARVADOS_RAILS_LOG_TO_STDOUT"]
25   Rails.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
26 end
27
28 module ArvadosWorkbench
29   class Application < Rails::Application
30     # The following is to avoid SafeYAML's warning message
31     SafeYAML::OPTIONS[:default_mode] = :safe
32
33     require_relative "arvados_config.rb"
34
35     # Initialize configuration defaults for originally generated Rails version.
36     config.load_defaults 5.1
37
38     # Settings in config/environments/* take precedence over those specified here.
39     # Application configuration should go into files in config/initializers
40     # -- all .rb files in that directory are automatically loaded.
41
42     # Custom directories with classes and modules you want to be autoloadable.
43     # Autoload paths shouldn't be used anymore since Rails 5.0
44     # See #15258 and https://github.com/rails/rails/issues/13142#issuecomment-74586224
45     # config.autoload_paths += %W(#{config.root}/extras)
46
47     # Only load the plugins named here, in the order given (default is alphabetical).
48     # :all can be used as a placeholder for all plugins not explicitly named.
49     # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
50
51     # Activate observers that should always be running.
52     # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
53
54     # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
55     # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
56     # config.time_zone = 'Central Time (US & Canada)'
57
58     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
59     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
60     # config.i18n.default_locale = :de
61
62     # Configure the default encoding used in templates for Ruby 1.9.
63     config.encoding = "utf-8"
64
65     # Configure sensitive parameters which will be filtered from the log file.
66     config.filter_parameters += [:password]
67
68     # Enable escaping HTML in JSON.
69     config.active_support.escape_html_entities_in_json = true
70
71     # Use SQL instead of Active Record's schema dumper when creating the database.
72     # This is necessary if your schema can't be completely dumped by the schema dumper,
73     # like if you have constraints or database-specific column types
74     # config.active_record.schema_format = :sql
75
76     # Enable the asset pipeline
77     config.assets.enabled = true
78
79     # Version of your assets, change this if you want to expire all your assets
80     config.assets.version = '1.0'
81
82     # npm-rails loads top-level modules like window.Mithril, but we
83     # also pull in some code from node_modules in application.js, like
84     # mithril/stream/stream.
85     config.assets.paths << Rails.root.join('node_modules')
86   end
87 end