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: a276e10f6f55ce7c4b4aedf82f58847599273e82fa86b001d02573ff56d70a59
4
- data.tar.gz: a8527baf9d848dbf81e3d989cd473718c859df54339df0e5172e795260b3410b
3
+ metadata.gz: 31b55dea3884f93640870ded7c0f4079cea1792d7842b05c0b3d1c610a463d0b
4
+ data.tar.gz: bc7faa9c4f0302159f57d5e1e376d697047fd0a0c2ad1c94f3fb651078a87395
5
5
  SHA512:
6
- metadata.gz: 6516197269ef7e03df7e4c75f1c474147b9332b82945a8f688791f5e739e204dc5b443b572812f8394a93e15a7cad73e43d853056116a375c568f56db9dd99bd
7
- data.tar.gz: f1966c816f63eba307e6e318d7ada4f7e3bf9280360695d6eb95859e7122cfbf8fbc2d34e2a68a5ab5489203c44e4aece02fb4759c6931fd3ed9d3e589530d0f
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
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "9.20.5"
2
+ VERSION = "9.20.6"
3
3
  end
@@ -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' },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.20.5
4
+ version: 9.20.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda