I have an ActiveRecord query:
Shareholder.where(is_company: false).distinct
which gives me the error:
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: could not identify an equality operator for type json
The SQL query created by ActiveRecord:
SELECT DISTINCT "shareholders".*
FROM "shareholders"
WHERE "shareholders"."deleted" = $1 AND "shareholders"."is_company" = $2
I'm a bit puzzled that this does not work. What is wrong?