在将我的应用程序从rails 5.2升级到rails 6之后,我遇到了这个问题
此模型适配器不支持从数据库中获取记录。
class PlayerArtController < ApplicationController
load_and_authorize_resource only: [:index, :create]
def index
end
def create
end
end版本:
rails (6.0.3.4)
癌病病(2.3.0)
ruby 2.7.2
发布于 2021-01-06 04:27:52
正如@Eyeslandic建议的那样,我最终将cancancan从2.3更新到3.0。
发布于 2021-07-09 11:00:40
CanCan::NotImplemented (This model adapter does not support fetching records from the database.):在更新gem之后,没有从数据库中获得记录,从而解决了以下问题:
# gem 'cancancan', '2.3.0' ## update version to new version
gem 'cancancan', '~> 3.3.0'https://stackoverflow.com/questions/65519159
复制相似问题