Open sjieg opened 8 years ago
I've investigated more into this problem. It seems the issue is not necessarily Lapis Lazuli.
When using :a
as a value in the find function, you're not directly creating a hash, but just adding a value to an array. So:
value = :a, :filter_by => :present?
#is the same as
[
:a,
{
:filter_by => :present?
}
]
But when using the long notation, the selector will be a hash instead of a array:
value = :element => a, :filter_by => :present?
# is the same as
{
:element => :a,
:filter_by => :present?
}
This difference is causing LL to ignore the :context:
given with an element, because the :context
is in a Hash, inside an Array inside a Hash.
For now this is too much effort to change, and the solution for now should be to not use direct selections.
Reproduce:
The above shows that LL isn't throwing an error when only searching for an element (without any attribute or value).
Workaround:
Note that
:filter_by => :present?
is not necessary, because this is the LL default. I've added it to emphasize on it.