viitenumero 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/viitenumero/version.rb +1 -1
- data/lib/viitenumero/viite_validator.rb +6 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e7ce3fcf81240d447d86381763b7443af1c537c
|
4
|
+
data.tar.gz: 3fd6dd902c18e886f1402072ad257e776c170f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be8645d775a8d373a8eb1b33aeb504272fb618561442025b2bef61f8049a810b514f2aaa86dcba92670d4700beabe3fd9c747dd5eff76703f71c45dca6247705
|
7
|
+
data.tar.gz: df353b5856290b84c25d13fab4e6f14af831ed33a9e252c2903803a57febcec635a772c3ba45e56122516cb9916fd9ed8ceefbecf9ba1710314975f1faa5d4e3
|
data/lib/viitenumero/version.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Viitenumero
|
2
|
+
class ViiteValidator < ActiveModel::EachValidator
|
3
|
+
def validate_each(record, attribute, value)
|
4
|
+
record.errors[attribute] << (options[:message] || 'on virheellinen') unless Viite.valid?(value)
|
5
|
+
end
|
6
|
+
end
|
5
7
|
end
|