You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception: TypeError: nil can't be coerced into Integer
--
0: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validators/standard_modulus.rb:18:in `*'
1: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validators/standard_modulus.rb:18:in `block (2 levels) in valid?'
2: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validators/standard_modulus.rb:15:in `each_pair'
3: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validators/standard_modulus.rb:15:in `each'
4: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validators/standard_modulus.rb:15:in `reduce'
5: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validators/standard_modulus.rb:15:in `block in valid?'
6: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validators/base_validator.rb:20:in `applying_exceptions'
7: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validators/standard_modulus.rb:14:in `valid?'
8: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validator.rb:46:in `block in valid?'
9: /Users/davidbourguignon/.rvm/gems/ruby-2.5.3@drivy-rails/gems/uk_account_validator-0.0.8/lib/uk_account_validator/validator.rb:39:in `each'
I looked a bit into it, but I don't know enough how this is suppose to work.
I checked on https://www.sortcodes.co.uk/ and apparently this is an invalid code.
Any clue?
The text was updated successfully, but these errors were encountered:
I'm afraid I can't really tell you much either - I wrote this a long time ago, and haven't actively used it since.
My guess is the problem here is the account number being 7 digits long - I would usually expect it to be 8, although I do recall there being some exceptions. If the sort code was invalid, the code might not take the correct exception (an overloaded word here... 🙄), so we've ended up trying to multiply by the 8th account number (which is nil).
If you fancy putting together a PR that tests for this case, I believe the correct behaviour would be to prefix the account number with a 0 (but it may be that this is already correctly handled when the sort code is correct - I'm afraid I forget).
I don't think I'd be comfortable merging anything without also testing a valid 7 digit account number though - I believe these are typically Lloyds or TSB.
Hi,
With last version, trying to validate:
UkAccountValidator::Validator.new("6833861", "779136").valid?
Give this error:
I looked a bit into it, but I don't know enough how this is suppose to work.
I checked on https://www.sortcodes.co.uk/ and apparently this is an invalid code.
Any clue?
The text was updated successfully, but these errors were encountered: