Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enhancement
Description
To make room for the redesigned functionality, I added another resolver,
Resolver::Resources
.This resolver will partition the incoming resource definitions into those that have an SGID and those that don't, and treat them differently.
Because I was referring to a data clump of
signed_params
,sgids
etc. all the time, I wrapped them into a new classResourceDefinition
. It's capable of returning aselector
and acontroller
.I left the resolution of a
renderer
outside this class and put it into arenderer_for
method, because it needs aconnection
attribute to function, which would have blurred the boundaries if it went intoResourceDefinition
.It's a bit weird to have it in
Resolver::Resources
in the first place, but I think I can live with that until a further refactoring.Closes #78
Why should this be added
The core value of this is a performance improvement by using
locate_many
, which will avoid N+1 queries in the event that more than one element with an SGID attached should be present.Checklist