Closed camallen closed 9 years ago
In order to include include the top_level link to the classifications in restpack you have to include them as a whole. We should override this behaviour or replace restpack.
What's the use case for having the top level classification links on the serialised user response?
Because the responses need to have thr url link to all their related models. That's how clients figure out how to navigate the api. Overriding restpack to just have the url link and not the list of ids is pretty easy. I think I do it in another one of the serializers. On Jan 30, 2015 5:30 PM, "Campbell Allen" notifications@github.com wrote:
What's the use case for having the top level classification links on the serialised user response?
— Reply to this email directly or view it on GitHub https://github.com/zooniverse/Panoptes/issues/471#issuecomment-72289048.
Right so it's just ensuring a valid hypermedia API. I'll look into why RP is querying the associations even when not serialising them via the optional include param.
Firstly why do we include the classification sets of a user on their index route?
Also it seems Restpack is querying the includes even when not actually using them. This will be pretty slow for basic index routes on users (especially as classifications come in).
https://github.com/zooniverse/Panoptes/blob/671ba191fb30193de8104b442a009714990f7a61/app/serializers/user_serializer.rb#L4
Index route (no include params) result set:
Test Log DB queries: