Skip to content

Commit

Permalink
changes String#last to [-1], since this is Rails-only and makes some …
Browse files Browse the repository at this point in the history
…tests fail
  • Loading branch information
dgilperez committed Apr 22, 2017
1 parent dbaa9a2 commit 9b38a7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spanish_vat_validators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def validate_cif(v)
end

sum = (even + odd).to_s
unumber = sum.last.to_i
unumber = sum[-1].to_i
unumber = (10 - unumber).to_s
unumber = 0 if(unumber.to_i == 10)
((last.to_i == unumber.to_i) || (last == uletter[unumber.to_i]))
Expand Down

0 comments on commit 9b38a7b

Please sign in to comment.