From 001122ef92068a4a18d182a52fada72bcba01f0c Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 29 Sep 2016 13:44:27 -0700 Subject: [PATCH] Remove unnecessary to_s from try_type_from_number Our CARD_TYPES hash now uses strings as keys so we no longer need to stringify them. --- core/app/models/spree/credit_card.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/models/spree/credit_card.rb b/core/app/models/spree/credit_card.rb index 8a996880894..7b20fabfb4f 100644 --- a/core/app/models/spree/credit_card.rb +++ b/core/app/models/spree/credit_card.rb @@ -106,7 +106,7 @@ def set_last_digits # number, otherwise the empty string def try_type_from_number CARD_TYPES.each do |type, pattern| - return type.to_s if number =~ pattern + return type if number =~ pattern end '' end