Skip to content

Commit

Permalink
Library is already checking for Luhn, so don't duplicate this work.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmortlock committed Dec 12, 2016
1 parent b78ed6f commit 3359194
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/sensitive_data_filter/types/credit_card.rb
Expand Up @@ -23,9 +23,7 @@ module CreditCard
module_function def valid?(number)
return false unless number.is_a? String
return false unless number.match CARD
credit_number = number.gsub(SEPARATORS, '')
return false unless CreditCardValidations::Luhn.valid?(credit_number)
CreditCardValidations::Detector.new(credit_number).brand.present?
CreditCardValidations::Detector.new(number.gsub(SEPARATORS, '')).brand.present?
end

module_function def scan(value)
Expand Down

0 comments on commit 3359194

Please sign in to comment.