When searching on a text field, using the default conditions, I get the following error:
ActiveRecord::StatementInvalid (PG::UndefinedObject: ERROR: type "VARCHAR" does not exist
The full query being generated is:
SELECT
COUNT(*)
FROM
(
SELECT
DISTINCT "hand_histories"."id"
FROM
"hand_histories"
INNER JOIN "hands" ON "hands"."id" = "hand_histories"."hand_id"
INNER JOIN "positions" ON "positions"."id" = "hand_histories"."position_id"
INNER JOIN "bet_sizes" ON "bet_sizes"."id" = "hand_histories"."bet_size_id"
INNER JOIN "table_sizes" ON "table_sizes"."id" = "hand_histories"."table_size_id"
WHERE
CAST("hand_histories"."note" AS "VARCHAR") ILIKE '%man%'
) subquery_for_count
If I copy the query directly into psql console, I get the same error. If I remove the quote marks around "VARCHAR" then it works. These quote marks seem to be the problem.
When searching on a text field, using the default conditions, I get the following error:
The full query being generated is:
If I copy the query directly into psql console, I get the same error. If I remove the quote marks around "VARCHAR" then it works. These quote marks seem to be the problem.