Rails/Pundit ArgumentError (wrong number of arguments (2 for 0))

拥有回忆 提交于 2019-12-06 09:48:40
  1. The scope should not inherit from DesignPolicy https://github.com/elabs/pundit#scopes
  2. You need to setup DesignPolicy to have an initialize method as well https://github.com/elabs/pundit#policies

If you have them inheriting from ApplicationPolicy, then you don't need to have the initialize methods setup in each policy. The pundit documentation is excellent, I reference it almost every day. As long as you know about classes and inheritance in Ruby, you should have no problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!