activemodel-embedding 0.3.0 → 0.3.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
  SHA256:
3
- metadata.gz: 2780103f79ecfcaf7824e83db61ca4391b598835bd470e42af26623e496ce610
4
- data.tar.gz: 78d41771cde753e632f9011976a5f450a347f5c7228bca10396b51e352452cb4
3
+ metadata.gz: 4023785e62fab8246dc3c748f42810d6591a26d0ba580a12d2477afac1e3c01b
4
+ data.tar.gz: a618e6a770d2003c399f8dc9942db4e56991978cd9a6992e70f0224bfc0e5324
5
5
  SHA512:
6
- metadata.gz: 5cb38dc53926813cfc9b619563642155d8e6173d2d7687d4965fadf838f1950577306f08bff37847a8600d20da9c795ac70bef9ffbc175fe45059250e7d2f412
7
- data.tar.gz: ed7653f0dc4ada82380362746254848d45f42b6483960c832f21f48536ff69592d601385996b2a28e0381805ec97e7ca02b904ffde6bdf8f91aea7e91c7bdcd4
6
+ metadata.gz: 13a8ce8726f54af05661a318524f640fd82934dcbf600a2baf027ce329d89be047da2ae6a60ab7ddabaf44359354c74d044f421ffce60f487cdf8c9b6ec7a916
7
+ data.tar.gz: 53f02da4ffdbb51740d0c5cfc18d6274e532e02f38c1ffe59d3b1ffb9f4050592373a6f4a7358b5981e4d0392488d5db25798c431e11c397b18ec2033a3c002e
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  module Embedding
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -39,10 +39,14 @@ module ActiveModel
39
39
  return unless value
40
40
 
41
41
  if collection?
42
+ return value if value.respond_to? :document_class
43
+
42
44
  documents = value.map { |attributes| process attributes }
43
45
 
44
46
  collection_class.new(documents)
45
47
  else
48
+ return value if value.respond_to? :id
49
+
46
50
  process value
47
51
  end
48
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel-embedding
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mansakondo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-09 00:00:00.000000000 Z
11
+ date: 2021-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails