-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Rendering scope method lookups #28
Comments
Is this a bug or intended? |
It looks like a bug.
|
@viking This is an update after an extensive debugging session. Lotus::View uses Each subclass can override some methods to customize the behavior: eg This implementation wants concrete methods from the given scope, because it does some tricks by bounding and then unbounding methods to it. In other words, it doesn't send the As proof of what I'm saying, add your failing test, and modify the source of def select
'x'
end It will invoke this method, instead of /cc @judofyr |
It appears that Rendering::Scope uses method_missing to delegate method There's two solutions: (1) Inherit from BasicObject instead. (2) Explicitly // Magnus Holm |
@judofyr It works like a charm ✨ Thank you! |
Excellent. Thanks. |
Resolve methods from scope in order of data, context, partials
If I have a View method called
select
, if I try to callselect
in the template, it callsKernel#select
instead of my view'sselect
method.The output of
p method(:select)
in the context of the template is:The text was updated successfully, but these errors were encountered: