I am using pundit gem to authorize in my system app. before to implement pundit I had my endpoint index like this:
def index
@cars = Car.all
render json: @cars
end
worked ok, but now with pundit, i made a change like this
def index
@cars = Car.all
authorize @cars
end
Now I am getting this error:
current_user must be defined before the impersonates method