remote_record 0.9.3 → 0.10.0

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: c9a29d724b9f37942e9346bbdcd49fe6ae51e94361c1ea4b73397c4e59b0b6c8
4
- data.tar.gz: 0c25f5d964e1d989768089eac19896dfeedcc34850ea65c60744e136adabdcc8
3
+ metadata.gz: 6195e3ad6e5c63b1530d5095ed625ce175e8159c55f1a6e62951494a0437cb4e
4
+ data.tar.gz: 77f9c737aada2d4482ac135a615eaeefede9bd8e251eb85fec1c471c2946e86c
5
5
  SHA512:
6
- metadata.gz: 6796cdb033366d0f47840891d5f20000d6d465a3ac223ba147707634fe23c6ab5abb99bbf29bc796e0f65410cce1f5de3bcbfef25c6167c0e227e5403790998e
7
- data.tar.gz: e14ba4c233285f71b3734763f0f2ff0a9ea4562be2d6d008eb8d1811785f901bdb0814920a0e2228a7c31a7cf258cca2787f7469234e2b6d6ba18b768ad347da
6
+ metadata.gz: c9d19935c0daea74f1bc1acc82369d0f091a9663e5f01fb8947202dd078a829ff59c852a39be4f2b544177eec4fb959e2c8ba5649755edcb1815f6d7defe4b80
7
+ data.tar.gz: 7f61f43a6b73734ddc22b9fbf13ec43c2761e3f99d7a0a8e0da35766492a57253f5fd981469fae93d189ebc859a0e43cee59c4bf114514995f2d2a244bcc3f1c
@@ -42,9 +42,11 @@ module RemoteRecord
42
42
  prefetched_record = response.find do |resource|
43
43
  yield(resource).to_s == record.public_send(@id_field).remote_resource_id
44
44
  end
45
- record.remote.attrs = prefetched_record if prefetched_record.present?
45
+ next nil unless prefetched_record.present?
46
+
47
+ record.remote.attrs = prefetched_record
46
48
  record
47
- end
49
+ end.compact
48
50
  end
49
51
 
50
52
  def match_remote_resources_by_id(response)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RemoteRecord
4
- VERSION = '0.9.3'
4
+ VERSION = '0.10.0'
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.3
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Fish