remote_record 0.9.2 → 0.10.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: ffa98f2c80cd8bb5cf1c297a30e878a09a056daa139d8109a7179d9076c56f21
4
- data.tar.gz: df9f87372e8ad4e348db5980acfd7912ed9cbd91fd4c06f18718627b58357c31
3
+ metadata.gz: a1c720779bdc51677aa64f2b7cffe72a50bea619929b147ffca2c45e5fe3a9f7
4
+ data.tar.gz: a81b858886378e8ce10ef050e1dee0bf13dc8c86c906b732871d15082ea2681e
5
5
  SHA512:
6
- metadata.gz: 9f522c6b252935a1340de6ea9ebdc6a8825610199a71ecbdfb6cbc4de9202167d34326b239bed5b80f14cca2353572a7af96d7f61a703d4dd746056ed6111e99
7
- data.tar.gz: b5875964305b1cad3a96765f5e0e19714032d47c093701c63ededd93e9aaa7389c907fcfc4d7949588fa6f8a6a3103d7cfb5074714de1ddd18cb29d4b59a8d6a
6
+ metadata.gz: dbe00ce5701e5bc9b0de1ee6f0320079076e3dd30f7c40ae4283be75275411110fe5575fdb84fd4ed7a5d09a1f61f59ead3b7e5a9b0e32ff398737df5208a654
7
+ data.tar.gz: 856479b0661b3ccb3f0ca6a971610c69ce5073c6157d60d7228f2db27d7d25607d0b81c47275eaa715f59dddb831901faf72ffa68db4531f6f76d5609a65b621
@@ -46,6 +46,7 @@ module RemoteRecord
46
46
 
47
47
  def attrs=(new_attrs)
48
48
  @attrs.update(new_attrs)
49
+ @fetched = true
49
50
  end
50
51
 
51
52
  def fresh
@@ -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.2'
4
+ VERSION = '0.10.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.2
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Fish
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-21 00:00:00.000000000 Z
12
+ date: 2021-10-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord