active_remote 6.1.2 → 7.0.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 +4 -4
- data/.github/workflows/ruby.yml +32 -0
- data/.rubocop.yml +1 -1
- data/active_remote.gemspec +4 -2
- data/lib/active_remote/integration.rb +2 -2
- data/lib/active_remote/version.rb +1 -1
- data/spec/lib/active_remote/association_spec.rb +18 -18
- data/spec/lib/active_remote/integration_spec.rb +2 -2
- data/spec/lib/active_remote/rpc_spec.rb +1 -1
- metadata +24 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5d6d1d6040bd75c0cca252f6a01f6b0890a820a0fa790b39ebbd1169d1d170
|
4
|
+
data.tar.gz: 19a2409dd136d2f444702b5643ef892cbaf0fbc78cdc6778d843b478ab61b302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c89162b7d9d677f769fea69caf1da05b79cc761edeff2ea4254cb00c28ca79e9cd145d5bf9c61ec4f4992ce11efd39c287006b5e3fabda08809466b1b57e47c
|
7
|
+
data.tar.gz: ae1efa2152a5a0f7100c9bab0aac160047d28a9104e76bee18ae0ccb7befbea534c8810ae336baaa4161ec1f03c6730eb029f86df1538c04b768e868467f6a98
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
|
6
|
+
# GitHub recommends pinning actions to a commit SHA.
|
7
|
+
# To get a newer version, you will need to update the SHA.
|
8
|
+
# You can also reference a tag or branch, but the action may change without warning.
|
9
|
+
|
10
|
+
name: Ruby CI
|
11
|
+
|
12
|
+
on:
|
13
|
+
push:
|
14
|
+
branches: [ master ]
|
15
|
+
pull_request:
|
16
|
+
branches: [ master ]
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
test:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
strategy:
|
22
|
+
fail-fast: false
|
23
|
+
matrix:
|
24
|
+
ruby: [2.5, 2.6, 2.7, head, debug, jruby-9.3, jruby-9.4, jruby-head, truffleruby, truffleruby-head]
|
25
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
26
|
+
steps:
|
27
|
+
- uses: actions/checkout@v4
|
28
|
+
- uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
|
29
|
+
with:
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
31
|
+
- run: bundle install
|
32
|
+
- run: bundle rspec
|
data/.rubocop.yml
CHANGED
data/active_remote.gemspec
CHANGED
@@ -17,11 +17,13 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
+
s.required_ruby_version = ">= 2.7.0"
|
21
|
+
|
20
22
|
##
|
21
23
|
# Dependencies
|
22
24
|
#
|
23
|
-
s.add_dependency "activemodel", "~>
|
24
|
-
s.add_dependency "activesupport", "~>
|
25
|
+
s.add_dependency "activemodel", "~> 7.0", "< 7.1"
|
26
|
+
s.add_dependency "activesupport", "~> 7.0", "< 7.1"
|
25
27
|
s.add_dependency "protobuf", ">= 3.0"
|
26
28
|
|
27
29
|
##
|
@@ -64,7 +64,7 @@ module ActiveRemote
|
|
64
64
|
when new_record? then
|
65
65
|
"#{model_name.cache_key}/new"
|
66
66
|
when ::ActiveRemote.config.default_cache_key_updated_at? && (self.respond_to?(:[]) && timestamp = self["updated_at"]) then
|
67
|
-
timestamp = timestamp.utc.
|
67
|
+
timestamp = timestamp.utc.to_fs(self.class.cache_timestamp_format)
|
68
68
|
"#{model_name.cache_key}/#{send(primary_key)}-#{timestamp}"
|
69
69
|
else
|
70
70
|
"#{model_name.cache_key}/#{send(primary_key)}"
|
@@ -88,7 +88,7 @@ module ActiveRemote
|
|
88
88
|
# +false+ (which it is by default until Rails 6.0).
|
89
89
|
def cache_version
|
90
90
|
if cache_versioning && (timestamp = try(:updated_at))
|
91
|
-
timestamp.utc.
|
91
|
+
timestamp.utc.to_fs(:usec)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -15,12 +15,12 @@ describe ActiveRemote::Association do
|
|
15
15
|
it { is_expected.to respond_to(:author=) }
|
16
16
|
|
17
17
|
it "searches the associated model for a single record" do
|
18
|
-
expect(Author).to receive(:search).with(:guid => subject.author_guid).and_return(records)
|
18
|
+
expect(Author).to receive(:search).with({:guid => subject.author_guid}).and_return(records)
|
19
19
|
expect(subject.author).to eq record
|
20
20
|
end
|
21
21
|
|
22
22
|
it "memoizes the result record" do
|
23
|
-
expect(Author).to receive(:search).once.with(:guid => subject.author_guid).and_return(records)
|
23
|
+
expect(Author).to receive(:search).once.with({:guid => subject.author_guid}).and_return(records)
|
24
24
|
3.times { expect(subject.author).to eq record }
|
25
25
|
end
|
26
26
|
|
@@ -34,7 +34,7 @@ describe ActiveRemote::Association do
|
|
34
34
|
|
35
35
|
context "when the search is empty" do
|
36
36
|
it "returns a nil" do
|
37
|
-
expect(Author).to receive(:search).with(:guid => subject.author_guid).and_return([])
|
37
|
+
expect(Author).to receive(:search).with({:guid => subject.author_guid}).and_return([])
|
38
38
|
expect(subject.author).to be_nil
|
39
39
|
end
|
40
40
|
end
|
@@ -43,7 +43,7 @@ describe ActiveRemote::Association do
|
|
43
43
|
it { is_expected.to respond_to(:user) }
|
44
44
|
|
45
45
|
it "searches the associated model for multiple records" do
|
46
|
-
expect(Author).to receive(:search).with(:guid => subject.author_guid, :user_guid => subject.user_guid).and_return(records)
|
46
|
+
expect(Author).to receive(:search).with({:guid => subject.author_guid, :user_guid => subject.user_guid}).and_return(records)
|
47
47
|
expect(subject.user).to eq(record)
|
48
48
|
end
|
49
49
|
|
@@ -72,7 +72,7 @@ describe ActiveRemote::Association do
|
|
72
72
|
it { is_expected.to respond_to(:coauthor) }
|
73
73
|
|
74
74
|
it "searches the associated model for a single record" do
|
75
|
-
expect(Author).to receive(:search).with(:guid => subject.author_guid).and_return(records)
|
75
|
+
expect(Author).to receive(:search).with({:guid => subject.author_guid}).and_return(records)
|
76
76
|
expect(subject.coauthor).to eq record
|
77
77
|
end
|
78
78
|
|
@@ -90,7 +90,7 @@ describe ActiveRemote::Association do
|
|
90
90
|
it { is_expected.to respond_to(:bestseller) }
|
91
91
|
|
92
92
|
it "searches the associated model for a single record" do
|
93
|
-
expect(Author).to receive(:search).with(:guid => subject.bestseller_guid).and_return(records)
|
93
|
+
expect(Author).to receive(:search).with({:guid => subject.bestseller_guid}).and_return(records)
|
94
94
|
expect(subject.bestseller).to eq record
|
95
95
|
end
|
96
96
|
end
|
@@ -107,12 +107,12 @@ describe ActiveRemote::Association do
|
|
107
107
|
it { is_expected.to respond_to(:posts=) }
|
108
108
|
|
109
109
|
it "searches the associated model for all associated records" do
|
110
|
-
expect(Post).to receive(:search).with(:author_guid => subject.guid).and_return(records)
|
110
|
+
expect(Post).to receive(:search).with({:author_guid => subject.guid}).and_return(records)
|
111
111
|
expect(subject.posts).to eq records
|
112
112
|
end
|
113
113
|
|
114
114
|
it "memoizes the result record" do
|
115
|
-
expect(Post).to receive(:search).once.with(:author_guid => subject.guid).and_return(records)
|
115
|
+
expect(Post).to receive(:search).once.with({:author_guid => subject.guid}).and_return(records)
|
116
116
|
3.times { expect(subject.posts).to eq records }
|
117
117
|
end
|
118
118
|
|
@@ -126,7 +126,7 @@ describe ActiveRemote::Association do
|
|
126
126
|
|
127
127
|
context "when the search is empty" do
|
128
128
|
it "returns the empty set" do
|
129
|
-
expect(Post).to receive(:search).with(:author_guid => subject.guid).and_return([])
|
129
|
+
expect(Post).to receive(:search).with({:author_guid => subject.guid}).and_return([])
|
130
130
|
expect(subject.posts).to be_empty
|
131
131
|
end
|
132
132
|
end
|
@@ -135,7 +135,7 @@ describe ActiveRemote::Association do
|
|
135
135
|
it { is_expected.to respond_to(:flagged_posts) }
|
136
136
|
|
137
137
|
it "searches the associated model for a single record" do
|
138
|
-
expect(Post).to receive(:search).with(:author_guid => subject.guid).and_return([])
|
138
|
+
expect(Post).to receive(:search).with({:author_guid => subject.guid}).and_return([])
|
139
139
|
expect(subject.flagged_posts).to be_empty
|
140
140
|
end
|
141
141
|
end
|
@@ -144,7 +144,7 @@ describe ActiveRemote::Association do
|
|
144
144
|
it { is_expected.to respond_to(:bestseller_posts) }
|
145
145
|
|
146
146
|
it "searches the associated model for multiple record" do
|
147
|
-
expect(Post).to receive(:search).with(:bestseller_guid => subject.guid).and_return(records)
|
147
|
+
expect(Post).to receive(:search).with({:bestseller_guid => subject.guid}).and_return(records)
|
148
148
|
expect(subject.bestseller_posts).to eq(records)
|
149
149
|
end
|
150
150
|
end
|
@@ -153,7 +153,7 @@ describe ActiveRemote::Association do
|
|
153
153
|
it { is_expected.to respond_to(:user_posts) }
|
154
154
|
|
155
155
|
it "searches the associated model for multiple records" do
|
156
|
-
expect(Post).to receive(:search).with(:author_guid => subject.guid, :user_guid => subject.user_guid).and_return(records)
|
156
|
+
expect(Post).to receive(:search).with({:author_guid => subject.guid, :user_guid => subject.user_guid}).and_return(records)
|
157
157
|
expect(subject.user_posts).to eq(records)
|
158
158
|
end
|
159
159
|
|
@@ -191,12 +191,12 @@ describe ActiveRemote::Association do
|
|
191
191
|
it { is_expected.to respond_to(:author=) }
|
192
192
|
|
193
193
|
it "searches the associated model for all associated records" do
|
194
|
-
expect(Author).to receive(:search).with(:category_guid => subject.guid).and_return(records)
|
194
|
+
expect(Author).to receive(:search).with({:category_guid => subject.guid}).and_return(records)
|
195
195
|
expect(subject.author).to eq record
|
196
196
|
end
|
197
197
|
|
198
198
|
it "memoizes the result record" do
|
199
|
-
expect(Author).to receive(:search).once.with(:category_guid => subject.guid).and_return(records)
|
199
|
+
expect(Author).to receive(:search).once.with({:category_guid => subject.guid}).and_return(records)
|
200
200
|
3.times { expect(subject.author).to eq record }
|
201
201
|
end
|
202
202
|
|
@@ -210,7 +210,7 @@ describe ActiveRemote::Association do
|
|
210
210
|
|
211
211
|
context "when the search is empty" do
|
212
212
|
it "returns a nil value" do
|
213
|
-
expect(Author).to receive(:search).with(:category_guid => subject.guid).and_return([])
|
213
|
+
expect(Author).to receive(:search).with({:category_guid => subject.guid}).and_return([])
|
214
214
|
expect(subject.author).to be_nil
|
215
215
|
end
|
216
216
|
end
|
@@ -219,7 +219,7 @@ describe ActiveRemote::Association do
|
|
219
219
|
it { is_expected.to respond_to(:senior_author) }
|
220
220
|
|
221
221
|
it "searches the associated model for a single record" do
|
222
|
-
expect(Author).to receive(:search).with(:category_guid => subject.guid).and_return(records)
|
222
|
+
expect(Author).to receive(:search).with({:category_guid => subject.guid}).and_return(records)
|
223
223
|
expect(subject.senior_author).to eq record
|
224
224
|
end
|
225
225
|
|
@@ -232,7 +232,7 @@ describe ActiveRemote::Association do
|
|
232
232
|
it { is_expected.to respond_to(:primary_editor) }
|
233
233
|
|
234
234
|
it "searches the associated model for a single record" do
|
235
|
-
expect(Author).to receive(:search).with(:editor_guid => subject.guid).and_return(records)
|
235
|
+
expect(Author).to receive(:search).with({:editor_guid => subject.guid}).and_return(records)
|
236
236
|
expect(subject.primary_editor).to eq record
|
237
237
|
end
|
238
238
|
end
|
@@ -241,7 +241,7 @@ describe ActiveRemote::Association do
|
|
241
241
|
it { is_expected.to respond_to(:chief_editor) }
|
242
242
|
|
243
243
|
it "searches the associated model for multiple records" do
|
244
|
-
expect(Author).to receive(:search).with(:chief_editor_guid => subject.guid, :user_guid => subject.user_guid).and_return(records)
|
244
|
+
expect(Author).to receive(:search).with({:chief_editor_guid => subject.guid, :user_guid => subject.user_guid}).and_return(records)
|
245
245
|
expect(subject.chief_editor).to eq(record)
|
246
246
|
end
|
247
247
|
|
@@ -35,7 +35,7 @@ describe ::ActiveRemote::Integration do
|
|
35
35
|
::ActiveRemote.config.default_cache_key_updated_at = true
|
36
36
|
twenty_o_one_one = tag.updated_at = DateTime.new(2001, 0o1, 0o1)
|
37
37
|
expect(tag).to receive(:new_record?).and_return(false)
|
38
|
-
expect(tag.cache_key).to eq("tags/#{guid}-#{twenty_o_one_one.
|
38
|
+
expect(tag.cache_key).to eq("tags/#{guid}-#{twenty_o_one_one.to_fs(:usec)}")
|
39
39
|
tag.updated_at = nil
|
40
40
|
::ActiveRemote.config.default_cache_key_updated_at = false
|
41
41
|
end
|
@@ -91,7 +91,7 @@ describe ::ActiveRemote::Integration do
|
|
91
91
|
|
92
92
|
it "returns a cache version" do
|
93
93
|
tag.updated_at = DateTime.new(2001, 0o1, 0o1)
|
94
|
-
expect(tag.cache_version).to eq(tag.updated_at.utc.
|
94
|
+
expect(tag.cache_version).to eq(tag.updated_at.utc.to_fs(:usec))
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hutchison
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -16,28 +16,40 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '7.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7.1'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
29
|
+
version: '7.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7.1'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: activesupport
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
39
|
+
version: '7.0'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '7.1'
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
47
|
- - "~>"
|
39
48
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
49
|
+
version: '7.0'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '7.1'
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: protobuf
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,6 +201,7 @@ executables:
|
|
189
201
|
extensions: []
|
190
202
|
extra_rdoc_files: []
|
191
203
|
files:
|
204
|
+
- ".github/workflows/ruby.yml"
|
192
205
|
- ".gitignore"
|
193
206
|
- ".rspec"
|
194
207
|
- ".rubocop.yml"
|
@@ -264,7 +277,7 @@ files:
|
|
264
277
|
homepage: https://github.com/liveh2o/active_remote
|
265
278
|
licenses: []
|
266
279
|
metadata: {}
|
267
|
-
post_install_message:
|
280
|
+
post_install_message:
|
268
281
|
rdoc_options: []
|
269
282
|
require_paths:
|
270
283
|
- lib
|
@@ -272,15 +285,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
272
285
|
requirements:
|
273
286
|
- - ">="
|
274
287
|
- !ruby/object:Gem::Version
|
275
|
-
version:
|
288
|
+
version: 2.7.0
|
276
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
277
290
|
requirements:
|
278
291
|
- - ">="
|
279
292
|
- !ruby/object:Gem::Version
|
280
293
|
version: '0'
|
281
294
|
requirements: []
|
282
|
-
rubygems_version: 3.
|
283
|
-
signing_key:
|
295
|
+
rubygems_version: 3.5.6
|
296
|
+
signing_key:
|
284
297
|
specification_version: 4
|
285
298
|
summary: Active Record for your platform
|
286
299
|
test_files:
|