Skip to content

Commit d44f007

Browse files
committed
Change version checks to use floats
1 parent 0dbdd6f commit d44f007

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

example_app_generator/spec/support/default_preview_path

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ require_file_stub 'config/environment' do
3737
module ExampleApp
3838
class Application < Rails::Application
3939
config.eager_load = false
40-
if Rails::VERSION::STRING.start_with?('7')
40+
if Rails::VERSION::STRING.to_f >= 7.0
4141
config.active_support.cache_format_version = 7.0
4242
end
4343

4444
# Don't care if the mailer can't send.
4545
config.action_mailer.raise_delivery_errors = false unless ENV['NO_ACTION_MAILER']
4646
if ENV['CUSTOM_PREVIEW_PATH']
47-
if Rails::VERSION::STRING.start_with?('7.1')
47+
if Rails::VERSION::STRING.to_f >= 7.1
4848
config.action_mailer.preview_paths = [ENV['CUSTOM_PREVIEW_PATH']]
4949
else
5050
config.action_mailer.preview_path = ENV['CUSTOM_PREVIEW_PATH']

example_app_generator/spec/verify_mailer_preview_path_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def capture_exec(*ops)
3030
CaptureExec.new(out, $?.exitstatus)
3131
end
3232

33-
if Rails::VERSION::STRING.start_with?('7.1')
33+
if Rails::VERSION::STRING.to_f >= 7.1
3434
let(:expected_custom_path) { "/custom/path\n#{::Rails.root}/test/mailers/previews" }
3535
let(:expected_rspec_path) { "#{::Rails.root}/spec/mailers/previews\n#{::Rails.root}/test/mailers/previews" }
3636

0 commit comments

Comments
 (0)