forest_liana 9.20.5 → 9.20.6
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31b55dea3884f93640870ded7c0f4079cea1792d7842b05c0b3d1c610a463d0b
|
|
4
|
+
data.tar.gz: bc7faa9c4f0302159f57d5e1e376d697047fd0a0c2ad1c94f3fb651078a87395
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2e707a5df3a857e9bbb61c0cefa2d593feae5b724f05b3d18f45df2a0abdcc724d6db0367b514e89d9074c5646b8994d2c2d0330735b9da8e4a3810f5460317d
|
|
7
|
+
data.tar.gz: f757f804039e32d4ef70b0b544ca1297933d633ef063ff692fa79c5fc8d7ee5daeee817a859956c7ed4fcfaaab966ef2fc6dd70d47061cbcd1218e059136bcad
|
|
@@ -27,6 +27,11 @@ module ForestLiana
|
|
|
27
27
|
def count
|
|
28
28
|
find_resource
|
|
29
29
|
find_association
|
|
30
|
+
# NOTICE: find_association renders a 404 (without halting) when the
|
|
31
|
+
# association name does not resolve; stop here instead of falling
|
|
32
|
+
# through and dereferencing a nil @association, which surfaced as
|
|
33
|
+
# a double-render / 500 rather than the intended 404.
|
|
34
|
+
return if performed?
|
|
30
35
|
begin
|
|
31
36
|
getter = HasManyGetter.new(@resource, @association, params, forest_user)
|
|
32
37
|
getter.count
|
data/lib/forest_liana/version.rb
CHANGED
data/spec/requests/count_spec.rb
CHANGED
|
@@ -74,6 +74,20 @@ describe 'Requesting Owner', :type => :request do
|
|
|
74
74
|
end
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
+
describe 'count on an unknown relationship' do
|
|
78
|
+
params = {
|
|
79
|
+
fields: { 'Tree' => 'id,name,owner' },
|
|
80
|
+
page: { 'number' => '1', 'size' => '10' },
|
|
81
|
+
searchExtended: '0',
|
|
82
|
+
timezone: 'Europe/Paris'
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
it 'should respond 404 instead of 500' do
|
|
86
|
+
get '/forest/Owner/5/relationships/unknown_things/count', params: params, headers: headers
|
|
87
|
+
expect(response.status).to eq(404)
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
77
91
|
describe 'deactivate_count_response' do
|
|
78
92
|
params = {
|
|
79
93
|
fields: { 'Owner' => 'id,name' },
|