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: ea446173092e4c6df74a466d2033931a75fe1872b4c52c56ff28563e777dfa6c
4
- data.tar.gz: 7eb5bb8bd19def8aa41e6f4f1c4fc720f9724903742e3902acb8163fa5cdb500
3
+ metadata.gz: f44d7b9166ab63a3f1ea671f59bb152cea49b935111f57096e8669982063cd3b
4
+ data.tar.gz: 21d9661a28011ddca555b1ad36d188888de22d23a56fb3e114d6cc552ab649ca
5
5
  SHA512:
6
- metadata.gz: 62ba626e10a6479408b8a503aaae94ea9ecf590b824719e7a19c7f108b886f0c24e455bc22ac88a24ba133d1d403618e2ad2e98964832185dc6cb04afa1a7b61
7
- data.tar.gz: 2c92ebc0c68bd1584b6dabfbebfe83de6f0acccc682f01ce814ad129129c017678b6962043c25b490dae249251172abb871d9f69ec5d8ed57e01f102c3c65666
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
- elsif value.invalid?
13
- strategy.call(attribute, record.errors, value.errors)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StoreModel
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: store_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - DmitryTsepelev