Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/validates_russian/region_numbers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ValidatesRussian
REGION_NUMBERS = %w{01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 75 41 23 24 59 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 76 77 78 79 83 86 87 89 91 92}
REGION_NUMBERS = %w[01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 75 41 23 24 59 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 76 77 78 79 81 82 83 86 87 89 91 92 97 99].freeze
end
3 changes: 1 addition & 2 deletions lib/validators/kpp_format_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class KppFormatValidator < ValidatesRussian::Validator
validates_using do |kpp|
next false unless kpp.size == 9
next false unless ValidatesRussian::REGION_NUMBERS.include?(kpp[0..1])
next false unless kpp =~ /^\d+$/
next false unless kpp[5..6] != '00'
next false unless kpp =~ /^\d{4}([a-z]|\d){2}\d{3}$/i
end
end