0

I am trying to use Ransack to filter records that have an applicable policy_scope from Pundit.

class ItemsController < ApplicationController

  def index
    @q = policy_scope(Item).ransack(params[:q])
    @items = @q.result(distinct: true)
  end

end

This returns an error:

ActionView::Template::Error (PG::UndefinedFunction: ERROR:  could not identify an equality operator for type json
LINE 1: SELECT DISTINCT "items".* FROM "items" WHERE "items"."...

I know I'm not using Pundit and Ransack right in this instance, but I'm at a loss as to how I filter a set of scoped records.

What magic should I be doing?

Romuloux
  • 1,027
  • 1
  • 8
  • 24

0 Answers0