0
Good afternoon, I have a method to search for products in the bank that uses the with_query method of Gem acts_as_indexed:
Product.with_query(query_text)
This generates an SQL query like this:
SELECT produtos
.* FROM produtos
WHERE (products.id IN (NULL)) LIMIT 11
I have tested by replacing . with_query(query_text) with . all and the results are returned. I have already checked in my model products.Rb I have configured the fields for Gem to work (acts_as_indexed :Fields => [ :status, :name ]).
Does anyone have any idea why Gem is returning WHERE (products.id IN (NULL)) in the query? Thank you.
The same is true for the console
Product.with_query('Pump')
Load product (0.6ms) SELECT produtos
.* FROM produtos
WHERE (products.id IN (NULL)) LIMIT 11