-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dpl936 json api - 2 #3990
Dpl936 json api - 2 #3990
Conversation
apply_includes substitution Changes in type for relation in tests
…o dpl936_json_api
No has_many polymorphic supported
…rate more classes from ancestor_resource.rb file
…o dpl936_json_api
…to dpl936_json_api
@@ -0,0 +1,7 @@ | |||
# frozen_string_literal: true | |||
class ParentResource < JSONAPI::Resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParentResource has no descriptive comment
end | ||
|
||
# https://jsonapi.org/format/#document-resource-object-linkage | ||
def relationship_exists?(name, hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method relationship_exists?
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
@@ -39,49 +39,59 @@ def self.inclusions | |||
@default_includes || [].freeze | |||
end | |||
|
|||
# Extends the default behaviour to add our default inclusions if provided | |||
def self.apply_includes(records, options = {}) | |||
# TODO: Explain preloading and why we used it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
module Concerns | ||
module DefaultIncludesParser | ||
def parse_include_directives(resource_klass, raw_include) | ||
if resource_klass.respond_to?(:format_default_includes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Api::V2::Concerns::DefaultIncludesParser#parse_include_directives refers to 'resource_klass' more than self (maybe move it to another class?)
module Concerns | ||
module DefaultIncludesParser | ||
def parse_include_directives(resource_klass, raw_include) | ||
if resource_klass.respond_to?(:format_default_includes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Api::V2::Concerns::DefaultIncludesParser#parse_include_directives manually dispatches method call
@@ -0,0 +1,16 @@ | |||
# frozen_string_literal: true | |||
module Api | |||
module V2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Api::V2 has the name 'V2'
Code Climate has analyzed commit 381c45d and detected 28 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 97.9% (50% is the threshold). This pull request will bring the total coverage in the repository to 86.8% (0.0% change). View more on Code Climate. |
Although these changes pass unit tests here, they fail the integration suite tests. They are also inconsistent and low performance when they work. Because we are using a frozen 9.0 version of the dependency from a fork now, I am closing this PR. |
Closes #
Changes proposed in this pull request
Instructions for Reviewers
[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to
main
]- Check story numbers included
- Check for debug code
- Check version