lib/active_merchant/billing/check.rb in activemerchant-1.86.0 vs lib/active_merchant/billing/check.rb in activemerchant-1.87.0
- old
+ new
@@ -57,10 +57,10 @@
# Routing numbers may be validated by calculating a checksum and dividing it by 10. The
# formula is:
# (3(d1 + d4 + d7) + 7(d2 + d5 + d8) + 1(d3 + d6 + d9))mod 10 = 0
# See http://en.wikipedia.org/wiki/Routing_transit_number#Internal_checksums
def valid_routing_number?
- digits = routing_number.to_s.split('').map(&:to_i).select{|d| (0..9).include?(d)}
+ digits = routing_number.to_s.split('').map(&:to_i).select { |d| (0..9).cover?(d) }
case digits.size
when 9
checksum = ((3 * (digits[0] + digits[3] + digits[6])) +
(7 * (digits[1] + digits[4] + digits[7])) +
(digits[2] + digits[5] + digits[8])) % 10