speedy-af 0.6.0 → 0.6.1
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/lib/speedy_af/base.rb +2 -0
- data/lib/speedy_af/errors.rb +1 -0
- data/lib/speedy_af/version.rb +1 -1
- data/spec/integration/base_spec.rb +9 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0b87455a3724096083b0ee86c462df634780c3aa9a17e121087d7497610aa53
|
|
4
|
+
data.tar.gz: 845ce23c6ccdcc7ad89f130d8d6e850228c8e7fcd495b873c6c39048eabace61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed974b3a2adb1802befbc240ca0a3a3ff64de6d4af73e975bf941384de40ae1997082800da10cd2f722491bab2782a729ccd7a0cea2b668767920b45d9eab9f0
|
|
7
|
+
data.tar.gz: c2771b07ca48dab6179ea713762351c8de56edaac75c8e7e8619ca0decad6792a0d082e64e8280a0affd56460a6f44cfcb4454e1e657bfa960ac89f604026a87
|
data/lib/speedy_af/base.rb
CHANGED
|
@@ -43,7 +43,9 @@ module SpeedyAF
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def find(id, opts = {})
|
|
46
|
+
raise ArgumentError, "Couldn't find SpeedyAF::Base without an ID" if id.blank?
|
|
46
47
|
result = where(%(id:"#{id}"), opts.merge(rows: 1)).first
|
|
48
|
+
raise SpeedyAF::RecordNotFound, "Couldn't find SpeedyAF::Base with ID '#{id}'" if result.blank?
|
|
47
49
|
raise SpeedyAF::ModelMismatch if self != result.class && self != SpeedyAF::Base
|
|
48
50
|
result
|
|
49
51
|
end
|
data/lib/speedy_af/errors.rb
CHANGED
data/lib/speedy_af/version.rb
CHANGED
|
@@ -68,12 +68,20 @@ describe SpeedyAF::Base do
|
|
|
68
68
|
expect(book_presenter.publisher).to eq(book.publisher)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
+
it 'raises ArgumentError if id is blank' do
|
|
72
|
+
expect { SpeedyAF::Base.find(nil) }.to raise_error(ArgumentError, "Couldn't find SpeedyAF::Base without an ID")
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
it 'raises RecordNotFound if id is not found' do
|
|
76
|
+
expect { SpeedyAF::Base.find('foo') }.to raise_error(SpeedyAF::RecordNotFound, "Couldn't find SpeedyAF::Base with ID 'foo'")
|
|
77
|
+
end
|
|
78
|
+
|
|
71
79
|
context 'proxy subclass' do
|
|
72
80
|
it 'does not raise error for matching model' do
|
|
73
81
|
expect { SpeedyAF::Proxy::Book.find(book.id) }.to_not raise_error
|
|
74
82
|
end
|
|
75
83
|
it 'raises error for mismatched model' do
|
|
76
|
-
expect { SpeedyAF::Proxy::Book.find(
|
|
84
|
+
expect { SpeedyAF::Proxy::Book.find(library.id) }.to raise_error(SpeedyAF::ModelMismatch)
|
|
77
85
|
end
|
|
78
86
|
end
|
|
79
87
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: speedy-af
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael B. Klein
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-04-22 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: active-fedora
|
|
@@ -197,8 +197,8 @@ executables: []
|
|
|
197
197
|
extensions: []
|
|
198
198
|
extra_rdoc_files:
|
|
199
199
|
- CONTRIBUTING.md
|
|
200
|
-
- LICENSE
|
|
201
200
|
- README.md
|
|
201
|
+
- LICENSE
|
|
202
202
|
files:
|
|
203
203
|
- ".circleci/config.yml"
|
|
204
204
|
- ".gitignore"
|
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
256
256
|
- !ruby/object:Gem::Version
|
|
257
257
|
version: '0'
|
|
258
258
|
requirements: []
|
|
259
|
-
rubygems_version:
|
|
259
|
+
rubygems_version: 3.6.5
|
|
260
260
|
specification_version: 4
|
|
261
261
|
summary: Performance enhancements for ActiveFedora
|
|
262
262
|
test_files: []
|