Skip to content
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

include links should not include deactivated resources #3107

Open
camallen opened this issue Apr 4, 2019 · 0 comments
Open

include links should not include deactivated resources #3107

camallen opened this issue Apr 4, 2019 · 0 comments
Labels

Comments

@camallen
Copy link
Contributor

camallen commented Apr 4, 2019

Pandora is requesting projects resource with params id=669&current_user_roles=owner%2Ctranslator&include=workflows

The include is triggering restpack to sideload the project.has_many :workflows based on the linked project_id and ignores any activated state on the Workflow resource. E.g.

select * from workflows where project_id = 9 this doesn't respect the association state on the originating resource, e.g. project.workflows (only finds active workflows).

https://github.com/zooniverse/restpack_serializer/blob/a0c2bc4725dbdd86783f09c88054280e110da752/lib/restpack_serializer/serializable/side_load_data_builder.rb#L25

Ideally the underlying sideload methods respects the activated state of the resource - it currently gets the FK relation and the model ID only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant