snils 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/README.ru.md +1 -1
- data/lib/snils/rails.rb +4 -0
- data/lib/snils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99c4655619df5fecbcaaa1dac708f9fbb38405f2
|
4
|
+
data.tar.gz: 207dc1ae3644b46612577782e8abe73170ce12d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f84bff954d0023d02045428eef5f3982afece00c5a1b7fa5964e580c07cf27abc0d2e3d9a0cbd2962e40c5ba5f9912e6168eb3a7b5516aa895c177043e3c7e5
|
7
|
+
data.tar.gz: c154aff4dec2ae7e159272c7a733a48f6b02a16ced43e24e540c6f3a63847f57d4df4a19f5db0c73349fc9009e7805762682b4c7273225095f9792e8244485d8
|
data/README.md
CHANGED
data/README.ru.md
CHANGED
data/lib/snils/rails.rb
CHANGED
@@ -12,8 +12,12 @@ require 'snils'
|
|
12
12
|
#
|
13
13
|
# validates :snils, presence: true, uniqueness: true, snils: true
|
14
14
|
#
|
15
|
+
# Be aware of fact, that this validation doesn't require the value presence,
|
16
|
+
# use <tt>presence: true</tt> to require SNILS to be present.
|
17
|
+
#
|
15
18
|
class SnilsValidator < ActiveModel::EachValidator
|
16
19
|
def validate_each(record, attribute, value)
|
20
|
+
return if value.blank?
|
17
21
|
snils = Snils.new(value)
|
18
22
|
if snils.errors.any? && options[:message]
|
19
23
|
record.errors.add(attribute, options[:message])
|
data/lib/snils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Novikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|