From 4c076f34936b2e821c750a26a7cc63c9319d3a63 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Tue, 22 Oct 2019 15:06:21 +0200 Subject: [PATCH] Fix deprecation message for Spree::CreditCard Deprecation messages on `CreditCard#default` and `CreditCard#default=` are a bit misleading, as they print out `CreditCard.default` but they are actually referencing an instance method, not a class one. --- core/app/models/spree/credit_card.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/app/models/spree/credit_card.rb b/core/app/models/spree/credit_card.rb index c3f6362b8ae..9598a65b56a 100644 --- a/core/app/models/spree/credit_card.rb +++ b/core/app/models/spree/credit_card.rb @@ -47,13 +47,13 @@ def self.default }.freeze def default - Spree::Deprecation.warn("CreditCard.default is deprecated. Please use user.wallet.default_wallet_payment_source instead.", caller) + Spree::Deprecation.warn("CreditCard#default is deprecated. Please use user.wallet.default_wallet_payment_source instead.", caller) return false if user.nil? user.wallet.default_wallet_payment_source.try!(:payment_source) == self end def default=(set_as_default) - Spree::Deprecation.warn("CreditCard.default= is deprecated. Please use user.wallet.default_wallet_payment_source= instead.", caller) + Spree::Deprecation.warn("CreditCard#default= is deprecated. Please use user.wallet.default_wallet_payment_source= instead.", caller) if user.nil? raise "Cannot set 'default' on a credit card without a user" elsif set_as_default # setting this card as default