activemodel-embedding 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c01c4df6223c093586de6dfaab400aa0038ccd3d0d647190a7659f473b65645e
4
- data.tar.gz: 002ab8e0340a0c4d77bad5a8350a5c351f9e178f768052a84b72f157828292e3
3
+ metadata.gz: 2780103f79ecfcaf7824e83db61ca4391b598835bd470e42af26623e496ce610
4
+ data.tar.gz: 78d41771cde753e632f9011976a5f450a347f5c7228bca10396b51e352452cb4
5
5
  SHA512:
6
- metadata.gz: 04b3a70f58161bc302727fdb6d1c5a932c23a9b3503317359afc77e6154eed9b4d28ab2a62f50b85d5c62b721290ae07d8360ce2dbb9dc762b846a6585962ec4
7
- data.tar.gz: ecde4fa3045957a2f14430c6cacdb11af2f1400d711359dd8edacbdc28747a204d4c8b4a9053d6e15d76283969163239d52daed7c6c859e78f55a9e1d827ce8e
6
+ metadata.gz: 5cb38dc53926813cfc9b619563642155d8e6173d2d7687d4965fadf838f1950577306f08bff37847a8600d20da9c795ac70bef9ffbc175fe45059250e7d2f412
7
+ data.tar.gz: ed7653f0dc4ada82380362746254848d45f42b6483960c832f21f48536ff69592d601385996b2a28e0381805ec97e7ca02b904ffde6bdf8f91aea7e91c7bdcd4
@@ -22,7 +22,7 @@ module ActiveModel
22
22
  documents_attributes.each do |index, document_attributes|
23
23
  index = index.to_i
24
24
  id = fetch_id(document_attributes) || index
25
- document = find id if id
25
+ document = find_by_id id if id
26
26
 
27
27
  unless document
28
28
  document = documents[index] || build
@@ -33,7 +33,7 @@ module ActiveModel
33
33
  when Array
34
34
  documents_attributes.each do |document_attributes|
35
35
  id = fetch_id(document_attributes)
36
- document = find id if id
36
+ document = find_by_id id if id
37
37
 
38
38
  unless document
39
39
  document = build
@@ -46,7 +46,7 @@ module ActiveModel
46
46
  end
47
47
  end
48
48
 
49
- def find(id)
49
+ def find_by_id(id)
50
50
  documents.find { |document| document.id == id }
51
51
  end
52
52
 
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  module Embedding
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  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.2.0
4
+ version: 0.3.0
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-02 00:00:00.000000000 Z
11
+ date: 2021-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails