From fa06f447248c535274396ade03e1e7719e95ea97 Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Thu, 6 Dec 2018 23:04:04 +0100 Subject: [PATCH 1/3] Fix apply_free_shipping_promotions deprecation We were missing an alias_method here. Some code changed in Rails and now it correctly raises an exception since this old method, that has been removed, is not found. --- core/app/models/spree/order.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/core/app/models/spree/order.rb b/core/app/models/spree/order.rb index 250c8a9d8e8..d6ba055778c 100644 --- a/core/app/models/spree/order.rb +++ b/core/app/models/spree/order.rb @@ -552,6 +552,7 @@ def apply_shipping_promotions Spree::PromotionHandler::Shipping.new(self).activate recalculate end + alias_method :apply_free_shipping_promotions, :apply_shipping_promotions deprecate apply_free_shipping_promotions: :apply_shipping_promotions, deprecator: Spree::Deprecation # Clean shipments and make order back to address state From 40605681840bc4853c9a1cffaa8860c414c96c03 Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Thu, 6 Dec 2018 23:05:58 +0100 Subject: [PATCH 2/3] Fix Spree::Store#by_url deprecation deprecate method takes a list of methods so current code is actually deprecating a method named: "Spree::Store.by_url is DEPRECATED". For some reason this code was working until Rails 5.2.1 --- core/app/models/spree/store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rb index aa1ec02cd98..267514550cf 100644 --- a/core/app/models/spree/store.rb +++ b/core/app/models/spree/store.rb @@ -28,7 +28,7 @@ class Store < Spree::Base scope :by_url, lambda { |url| where("url like ?", "%#{url}%") } class << self - deprecate :by_url, "Spree::Store.by_url is DEPRECATED", deprecator: Spree::Deprecation + deprecate by_url: "Spree::Store.by_url is DEPRECATED", deprecator: Spree::Deprecation end def available_locales From 50346d6751961c4751642320ef1e3b4053ffacbf Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Thu, 6 Dec 2018 23:09:51 +0100 Subject: [PATCH 3/3] Revert "Lock Rails version up to 5.2.1" This reverts commit 6ad412fc8062958cf52c72569a14469b4f38ccb4. This should not be needed anymore since wrong deprecation calls has been fixed. --- core/solidus_core.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/solidus_core.gemspec b/core/solidus_core.gemspec index 561584ee2cb..12fd56a8d15 100644 --- a/core/solidus_core.gemspec +++ b/core/solidus_core.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| actionmailer actionpack actionview activejob activemodel activerecord activesupport railties ].each do |rails_dep| - s.add_dependency rails_dep, ['>= 5.1', '< 5.2.2'] + s.add_dependency rails_dep, ['>= 5.1', '< 5.3.x'] end s.add_dependency 'activemerchant', '~> 1.66'