When you have two scopes used, in the single view rendering, and you'll use path to the scope file instead of a class, you'll get only the first scope loaded, because of the caching.
Checking the code of the scope builder shows, that it allows to properly recognize the scope by file path, but because of caching, it falls back to the last defined.
When I use both used on the same page document, it appears, that the code is tried to be loaded with the first loaded scope class.
Flash Message#visible? - is called on the forms/input scope definition, because:
Flash is called in the layout (resolved later)
the form_input is used in the view partial, which is resolved first, to be injected into the layout
NOTE: This is not a case if you pass ScopeClass as an argument.
I expect the scope builder to properly resolve scopes, no matter if I pass class name, or the file path as argument, and not matter about the ordering of execution.
Background
When you have two scopes used, in the single view rendering, and you'll use
path
to the scope file instead of a class, you'll get only the first scope loaded, because of the caching.Checking the code of the scope builder shows, that it allows to properly recognize the scope by file path, but because of caching, it falls back to the last defined.
To Reproduce
TODO: Link the sample App.
I have the app having 2 scopes in use:
When I use both used on the same page document, it appears, that the code is tried to be loaded with the first loaded scope class.
Flash Message#visible
? - is called on theforms/input
scope definition, because:form_input
is used in the view partial, which is resolved first, to be injected into the layoutNOTE: This is not a case if you pass ScopeClass as an argument.
QuickFix: https://github.com/hanamimastery/app/commit/1dadcbf5e4be0227508107190ed9e0e02beb4ada
Expected behavior
I expect the scope builder to properly resolve scopes, no matter if I pass class name, or the file path as argument, and not matter about the ordering of execution.
Your environment