store_model 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f44d7b9166ab63a3f1ea671f59bb152cea49b935111f57096e8669982063cd3b
|
4
|
+
data.tar.gz: 21d9661a28011ddca555b1ad36d188888de22d23a56fb3e114d6cc552ab649ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e091ee24a2d81510188a2d42f02946718105c5a1ce8deab5e22b37cae8ad07f1891f6f2366a47858a6e4117b31ae83286a5bf5c70307d1496dab41129a82b177
|
7
|
+
data.tar.gz: aef72b9a2fe4fbd0fd23ff31376c44a339becd6176f8a131d4fd798dfddbfdc2527b3f966e5c7628fadb0b1bc3141d13bfe47562686c06def80a2fd58eee6b60
|
@@ -9,8 +9,14 @@ module ActiveModel
|
|
9
9
|
def validate_each(record, attribute, value)
|
10
10
|
if value.nil?
|
11
11
|
record.errors.add(attribute, :blank)
|
12
|
-
|
13
|
-
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
15
|
+
case record.type_for_attribute(attribute).type
|
16
|
+
when :json
|
17
|
+
strategy.call(attribute, record.errors, value.errors) if value.invalid?
|
18
|
+
when :array
|
19
|
+
record.errors.add(attribute, :invalid) if value.any?(&:invalid?)
|
14
20
|
end
|
15
21
|
end
|
16
22
|
|
data/lib/store_model/version.rb
CHANGED