ruby-on-railsruby-on-rails-6cancancan

This model adapter does not support fetching records from the database


After upgrading my application from rails 5.2 to rails 6 and I am getting this issue

This model adapter does not support fetching records from the database.

class PlayerArtController < ApplicationController
  load_and_authorize_resource only: [:index, :create]

  def index
     
  end

  def create
  end

end

Version:

rails (6.0.3.4)
cancancan (2.3.0)
ruby 2.7.2


Solution

  • As suggested by @Eyeslandic I ended up updating cancancan from 2.3 to 3.0