shopinvader / locomotive-shopinvader

LocomotiveCMS Plugin for Shopinvader
https://shopinvader.com
MIT License
12 stars 15 forks source link

with_scope, operators and ruby 2.6 #44

Open sbidoul opened 5 years ago

sbidoul commented 5 years ago

Hi,

It seems that with_scope keys containing an operator do not work with ruby 2.6.

As an example, the following syntax change makes them work again:

-      {% with_scope price.gt: {default: {discount: 0}}, "functions.in" => {id: product_functions } %}
+      {% with_scope "price.gt" => {default: {discount: 0}}, "functions.in" => {id: product_functions } %}

The symptom is that in places such as https://github.com/shopinvader/locomotive-shopinvader/blob/cef298fbce6cbaa29ae18f8d0f87a4a6491fb49d/lib/shop_invader/services/elastic_service.rb#L139

keys has value "t" instead of the value the developer intended (such as function.in).

I'm not sure if this issue arises in locomotive-shopinvader or upstream in locomotive.

sbidoul commented 5 years ago

cc/ @lmignon

sbidoul commented 5 years ago

@sebastienbeau @rvalyi do you have any opinion on this issue?