Upgrade to Rails 6.0 and apply new framework defaults

This commit is contained in:
Sebastian Serth
2021-05-10 22:04:49 +02:00
parent 3c4ff307af
commit 8378070bc2
25 changed files with 232 additions and 171 deletions

View File

@ -10,8 +10,8 @@ require 'telegraf/rails'
module CodeOcean
class Application < Rails::Application
# Initialize configuration defaults
config.load_defaults 5.2
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
@ -27,9 +27,21 @@ module CodeOcean
# config.i18n.default_locale = :de
config.i18n.available_locales = [:de, :en]
config.autoload_paths << Rails.root.join('lib')
config.eager_load_paths << Rails.root.join('lib')
config.assets.precompile += %w( markdown-buttons.png )
# Add inflection for Zeitwerk
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym 'IO'
end
extra_paths = %W[
#{config.root}/lib
]
# Add generators, they don't have a module structure that matches their directory structure.
extra_paths << "#{config.root}/lib/generators"
config.add_autoload_paths_to_load_path = false
config.autoload_paths += extra_paths
config.eager_load_paths += extra_paths
config.action_cable.mount_path = '/cable'