As part of sorting based on priority_id column label names, I have done the below code:
products = Product.where(id: pr_ids).order("priority_id IN(?)",ordered_priority_ids)
The below error is showing: ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near ")" LINE 1: ...ducts"."id" IN ($2, $3) ORDER BY priority_id IN(?), 4, 2, 3... ^ ):
Please help. Thanks