Skip to content

Commit 91cf48e

Browse files
authored
Fix local test failure (#97)
...that was passing in CI. In any case, the logic here is correct - `||=` will not assign if `opts[:include]` is an empty hash.
1 parent fe5373f commit 91cf48e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/jsonapi_compliable/base.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ def render_jsonapi(scope, opts = {})
288288
opts = default_jsonapi_render_options.merge(opts)
289289
opts = Util::RenderOptions.generate(scope, query_hash, opts)
290290
opts[:expose][:context] = self
291-
opts[:include] ||= deserialized_params.include_directive if force_includes?
291+
292+
if opts[:include].empty? && force_includes?
293+
opts[:include] = deserialized_params.include_directive
294+
end
295+
292296
perform_render_jsonapi(opts)
293297
end
294298

0 commit comments

Comments
 (0)