fields-serializer 0.8.0 → 0.8.1

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
  SHA1:
3
- metadata.gz: 7562bc90c01ce91c788ed85ba77cb9ea02d88d55
4
- data.tar.gz: 725b4a8754a0f6f4af0231faa0624083dc0ce3b7
3
+ metadata.gz: e2d7eea1eae67d97344677c9e9f61551ac51d688
4
+ data.tar.gz: bfd9e2424562e069e9c4c7ae27e87efe3863a3b6
5
5
  SHA512:
6
- metadata.gz: 72274afb9d88d5d6065ceb30e57394dbec24d92dc63819177b1a44ba1bdcbad3196c6f94567358c2cd6ff15b93d7816f10a67ef02ada440995de1f76ae1d7785
7
- data.tar.gz: 257b6dfc89ff1f87258825ebcef67cb41e9176ed9fc294c64ce954bc9e4c275990af0f4e70b19f451295c3784151e27f621c0e684cfb0525304081fdde008a70
6
+ metadata.gz: 4eff770dc241f46ef6cee15ded813831ad787ed203b03eeeac7ad7e201ac96967548f7c082cedc29db8eed9942c8eb8b92a3b06e12673ff8a52a0ebe51763821
7
+ data.tar.gz: a345685413e0901005840df3dc1dbef0d0c1399950763b1dfef29fd57ad76a8456628b4b2efba0afe1b86fe91fa346be6227b9068b77fd4b490f49066729014b
@@ -42,7 +42,7 @@ module Fields
42
42
  # { "xxx-xxxxxxxx-xxx-xxxxxx" => { name: ["can't be blank"], age: ["can't be less than 18"] },
43
43
  # "0" => { name: ["can't be blank"], age: ["can't be less than 18"] },
44
44
  def __associate_errors(associate)
45
- if associate.is_a?(Array)
45
+ if associate.is_a?(ActiveRecord::Associations::CollectionProxy)
46
46
  associate.map.with_index { |object, i| [object.id || i, object.errors.to_h] }.to_h
47
47
  else
48
48
  associate.errors.to_h
@@ -1,5 +1,5 @@
1
1
  module Fields
2
2
  module Serializer
3
- VERSION = "0.8.0"
3
+ VERSION = "0.8.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fields-serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Chinery