Ransack version: 4.0.0
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
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.
Looking at the documentation at using-predicate which reports the following result for the "_cont" predicate
>> User.ransack(first_name_cont: 'Rya').result.to_sql
=> SELECT "users".* FROM "users" WHERE ("users".."first_name" LIKE '%Rya%')
And the matching page at search-matches which reports the following match for the predicate "_cont"
Predicate: *_cont
Description: Contains value
Notes: use LIKE
When I run the query in my environment with PostgreSQL, the result is different:
irb> Common::Person.ransack(name_cont: 'Assem').result.to_sql
=> "SELECT \"common_people\".* FROM \"common_people\" WHERE \"common_people\".\"name\" ILIKE '%Assem%'"
Ransack version: 4.0.0
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
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.
Looking at the documentation at using-predicate which reports the following result for the "_cont" predicate
And the matching page at search-matches which reports the following match for the predicate "_cont"
When I run the query in my environment with PostgreSQL, the result is different: