0
を見つけることができない私は3 models
持っている:STIとPUNDIT - 政策
class Post < ApplicationRecord
class Diary < Post
class FuturePlans < Post
私はposts_controller.rb
で評論家も含まれています:
class BlogsController < ApplicationController
include Pundit
をそして私はpost_policy.rb
を持っている:
class BlogPolicy < ApplicationPolicy
class Scope < Scope
def resolve
return scope.all
end
end
私はいくつかの日記と未来プランを種まきにしました。コントローラ内部のアクション、私は次のエラーを取得する:
unable to find policy "DiaryPolicy" for "#<Diary id:...
は私が日記やFuturePlansのための個別のポリシーを作成する必要がありますか?私はどのようにして彼らにも専門家を継承させるのですか?私が専門家を無効にするとき、それはすべて働く。
ありがとうございます!