diff --git a/.circleci/config.yml b/.circleci/config.yml index 95a64bde67..1e40813dcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -150,16 +150,6 @@ jobs: - setup - test - postgres_rails52: - executor: postgres - parallelism: *parallelism - environment: - RAILS_VERSION: '~> 5.2.0' - DISABLE_ACTIVE_STORAGE: true - steps: - - setup - - test - workflows: build: jobs: @@ -171,5 +161,4 @@ workflows: - mysql - postgres_rails61 - postgres_rails60 - - postgres_rails52 - legacy_events diff --git a/core/lib/spree/core.rb b/core/lib/spree/core.rb index ab034ef5b0..6f188d3482 100644 --- a/core/lib/spree/core.rb +++ b/core/lib/spree/core.rb @@ -85,6 +85,15 @@ class GatewayError < RuntimeError; end end end +if Gem::Version.new(Rails.version) < Gem::Version.new('5.2') + Spree::Deprecation.warn <<~HEREDOC + Rails 5.2 (EOL) is deprecated and will not be supported anymore from the next Solidus version. + Please, upgrade to a more recent Rails version. + Read more on upgrading from Rails 5.2 to Rails 6.0 here: + https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-5-2-to-rails-6-0 + HEREDOC +end + require 'spree/core/version' require 'spree/core/active_merchant_dependencies' diff --git a/core/spec/lib/spree/event_spec.rb b/core/spec/lib/spree/event_spec.rb index 16f2ada45a..00038fae78 100644 --- a/core/spec/lib/spree/event_spec.rb +++ b/core/spec/lib/spree/event_spec.rb @@ -17,26 +17,17 @@ before do # ActiveSupport::Notifications does not provide an interface to clean all # subscribers at once, so some low level brittle code is required - if Rails.gem_version >= Gem::Version.new('6.0.0') - @old_string_subscribers = notifier.instance_variable_get('@string_subscribers').dup - @old_other_subscribers = notifier.instance_variable_get('@other_subscribers').dup - notifier.instance_variable_get('@string_subscribers').clear - notifier.instance_variable_get('@other_subscribers').clear - else - @old_subscribers = notifier.instance_variable_get('@subscribers').dup - notifier.instance_variable_get('@subscribers').clear - end + @old_string_subscribers = notifier.instance_variable_get('@string_subscribers').dup + @old_other_subscribers = notifier.instance_variable_get('@other_subscribers').dup + notifier.instance_variable_get('@string_subscribers').clear + notifier.instance_variable_get('@other_subscribers').clear @old_listeners = notifier.instance_variable_get('@listeners_for').dup notifier.instance_variable_get('@listeners_for').clear end after do - if Rails.gem_version >= Gem::Version.new('6.0.0') - notifier.instance_variable_set '@string_subscribers', @old_string_subscribers - notifier.instance_variable_set '@other_subscribers', @old_other_subscribers - else - notifier.instance_variable_set '@subscribers', @old_subscribers - end + notifier.instance_variable_set '@string_subscribers', @old_string_subscribers + notifier.instance_variable_set '@other_subscribers', @old_other_subscribers notifier.instance_variable_set '@listeners_for', @old_listeners end