Skip to content

Commit

Permalink
Simplify loading Rails version defaults in sandbox and spec dummy apps
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Jun 26, 2024
1 parent 8803380 commit 9087709
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
12 changes: 1 addition & 11 deletions sandbox/config/application.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
require_relative 'boot'

require 'rails/all'
require 'sprockets/railtie'

Bundler.require(*Rails.groups)
require "trestle"

module Sandbox
class Application < Rails::Application
# Initialize configuration defaults for current Rails version.
case Rails.version.split(".").first(2).join(".")
when '7.1'
config.load_defaults 7.1
when '7.0'
config.load_defaults 7.0
when '6.0'
config.load_defaults 6.0
when '5.2'
config.load_defaults 5.2
end
config.load_defaults Rails::VERSION::STRING.to_f

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down
11 changes: 1 addition & 10 deletions spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for current Rails version.
case Rails.version.split(".").first(2).join(".")
when '7.1'
config.load_defaults 7.1
when '7.0'
config.load_defaults 7.0
when '6.0'
config.load_defaults 6.0
when '5.2'
config.load_defaults 5.2
end
config.load_defaults Rails::VERSION::STRING.to_f

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down

0 comments on commit 9087709

Please sign in to comment.