Allow context to be set via call
#821
Merged
+12
−10
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.
This PR is doing more than one thing 🙈
If you want me to split this up, let me know. But in addition to allowing
context
to be passed viacall
, I've also moved whereview_context
is stored. It's now inside of thePhlex::Context
instead of in an ivar of SGML.I think that ultimately,
view_context
as a concept can be fully removed from Phlex, and only defined in phlex-rails which is the only place it gets used. But as I went down that path the changes got more and more complicated.phlex-rails
then needs to redefinecall
, which means it needs to be tightly coupled tophlex
's definition ofcall
... it got messy.Let me know what you think, and if you want me to leave
@_view_context
alone, that's fine too. I'll open a sibling PR over on phlex-rails to coincide with this change.