1

I have three models:

class Post < ApplicationRecord
class Diary < Post
class FuturePlans < Post

I have also included the pundit in posts_controller.rb:

class BlogsController < ApplicationController
 include Pundit

And I have a post_policy.rb:

class BlogPolicy < ApplicationPolicy

class Scope < Scope
 def resolve
  return scope.all
 end
end

I seeded some diaries and futureplans with bankseed, included pundit in all the actions inside the controller, and I get the following error:

unable to find policy "DiaryPolicy" for "#<Diary id:...

Should I make separate policies for Diary and FuturePlans? How do I make them inherit pundit as well? When I disable pundit it all works.

Thanks!

Tom Bom
  • 1,589
  • 4
  • 15
  • 38

1 Answers1

2

I created DiaryPolicy and FuturePlansPolicy and it works again.

Tom Bom
  • 1,589
  • 4
  • 15
  • 38