remote_record 0.9.1 → 0.9.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: a3b327ba09a62e4e8f611fd0cca0fc924069fdd374998a84bbe67a9c9435aa4a
4
- data.tar.gz: dc7b5a360c8090219ebf6408940c0ef32a71cb1d06f60987e4a71bd6658d777d
3
+ metadata.gz: ffa98f2c80cd8bb5cf1c297a30e878a09a056daa139d8109a7179d9076c56f21
4
+ data.tar.gz: df9f87372e8ad4e348db5980acfd7912ed9cbd91fd4c06f18718627b58357c31
5
5
  SHA512:
6
- metadata.gz: 8c7b4e58bbb751dd40c8f4ecea1828f5930ada30bb370f393fdbfa5f3711cea2720fae4d631112126bc70f2b58f6dbcfd8ccf3d46e7e2fb833572185413b8b3b
7
- data.tar.gz: 0e8d8988b94f9135be23ca340eea7b4ee4c117eeb82131620695df35d607846f9229b09782c30fd3be885eeb137889c9b57c6bfd093ce335ab4d780d7bd075e6
6
+ metadata.gz: 9f522c6b252935a1340de6ea9ebdc6a8825610199a71ecbdfb6cbc4de9202167d34326b239bed5b80f14cca2353572a7af96d7f61a703d4dd746056ed6111e99
7
+ data.tar.gz: b5875964305b1cad3a96765f5e0e19714032d47c093701c63ededd93e9aaa7389c907fcfc4d7949588fa6f8a6a3103d7cfb5074714de1ddd18cb29d4b59a8d6a
@@ -39,9 +39,10 @@ module RemoteRecord
39
39
 
40
40
  def match_remote_resources(response)
41
41
  @relation.map do |record|
42
- record.remote.attrs = response.find do |resource|
42
+ prefetched_record = response.find do |resource|
43
43
  yield(resource).to_s == record.public_send(@id_field).remote_resource_id
44
- end || {}
44
+ end
45
+ record.remote.attrs = prefetched_record if prefetched_record.present?
45
46
  record
46
47
  end
47
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RemoteRecord
4
- VERSION = '0.9.1'
4
+ VERSION = '0.9.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Fish