From 4b6ec70c80eb93456834a46b7b900e451c87e63e Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Tue, 9 Jan 2018 08:34:49 -0700 Subject: [PATCH] Improve deprecation message for 'deprecated_method_type_override' Previously stack trace line that the deprecation message would print was the `#partial_name` method inside PaymentMethod itself, which isn't very helpful. Also, print out corresponding class name. --- core/app/models/spree/payment_method.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/models/spree/payment_method.rb b/core/app/models/spree/payment_method.rb index 4d2c09b1432..633f9c67ad7 100644 --- a/core/app/models/spree/payment_method.rb +++ b/core/app/models/spree/payment_method.rb @@ -184,7 +184,7 @@ def partial_name # If method_type has been overridden, call it and return the value, otherwise return nil def deprecated_method_type_override if method(:method_type).owner != Spree::PaymentMethod - Spree::Deprecation.warn "overriding PaymentMethod#method_type is deprecated and will be removed from Solidus 3.0 (override partial_name instead)", caller + Spree::Deprecation.warn "#{method(:method_type).owner} is overriding PaymentMethod#method_type. This is deprecated and will be removed from Solidus 3.0 (override partial_name instead).", caller[1..-1] method_type end end