SQL `CASE WHEN ... THEN ... END` `order`
Company
.where('ticker = ? OR name ilike ?', str, "%#{str}%")
.order(%{
CASE WHEN ticker = #{Company.sanitize str} THEN 0 ELSE 1 END,
})
※ Pagination (`id` `name` )