Hey guys. I again. When I use ransack inside AVO w...
# avo-2
m
Hey guys. I again. When I use ransack inside AVO with the "field_cont: params[:q]" parameter, I should use PostgreSQL LIKE, but AVO always uses ILIKE, as if it had used the "field_i_cont: params[:q]" configuration, with the vowel "i" before "_cont". Would anyone know how to switch to using LIKE?
l
Hi @microscopic-dream-82397 i just noticed that behavior, are you sure this is a Avo issue and not a ransack one?
m
I haven't tested it outside of AVO Paul, I've just looked at the ransack documentation. I'll test it out to see if it's a ransack 4 issue. Thanks again.
l
Thanks! W8ing for feedback
m
True, Paul, the problem is Ransack's behavior. The documentation doesn't agree with what ransack does. Despite the existence of predicates, "*_cont" for LIKE and "*_i_cont" for ILIKE, for PostgreSQL it treats both as one thing, including the result expected by the test https://github.com/activerecord-hackery/ransack/blob/main/spec/ransack/predicate_spec.rb. I believe it shouldn't be like that, since there may be performance differences between LIKE and ILIKE, in addition to diverging from the documentation.
l
That's "good news" for us. Thank you for testing it out