pundit icon indicating copy to clipboard operation
pundit copied to clipboard

[Request] Generate policy file when using scaffolding

Open ghost opened this issue 3 years ago • 3 comments

Hi,

It would be great if running

rails g scaffold Model
rails g controller Model

would actually generate an empty policy file that inherits from ApplicationPolicy.

As a bonus, for resources scaffolding, maybe we could implements all CRUD actions and defaults to false.

ghost avatar May 09 '22 14:05 ghost

Linking this in case it helps the implementation https://gist.github.com/annikoff/331f785aa7a207a7945b1eca6eff526b

james-em avatar May 09 '22 14:05 james-em

FYI this came up again with #785, so I suggested moving that into here.

Burgestrand avatar Oct 16 '23 10:10 Burgestrand

Hi, I've added https://github.com/varvet/pundit/pull/794

hoverjet avatar Feb 28 '24 01:02 hoverjet