Y24-213 - Remove use of default_includes
in API v2 resources and the underlying support for it
#4233
Labels
default_includes
in API v2 resources and the underlying support for it
#4233
Summary
A decent number of our JSONAPI::Resources use
default_includes
for things like:uuid_object
and this probably worked 7 years ago when it was added, but this is no longer true.What are we doing?
In many resources, one example of which is PlateTemplateResource, we are using a method which we added to BaseResource to record which related records we should include when a request is made for the resource. These default includes are then recorded via an
inclusions
method and used to modify the behaviour ofapply_includes
which JSONAPI::Resources is supposed to call when it wants to find out which related resources to include in a response.How do we know it's no longer needed?
As can be seen in the upgrade checker rake task for JSONAPI::Resources, they no longer call the
apply_includes
method which is the core of ourdefault_includes
functionality. So our implementation does nothing.What needs to happen?
default_includes
and directs it through to the override ofapply_includes
. We should not be overriding that deprecated method any more.default_includes
from any resources that are specifying it.The text was updated successfully, but these errors were encountered: