我设置了rolify gem并捆绑了我的应用程序:gem "rolify" #to add roles like admin and member to the usersbundle installrails g rolify Role UserCould not find generator rolify.
当前正在尝试将rolify安装到我的rails应用程序/home/alex/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rolify-5.2.0/lib/rolify.rb:30: warning: Using the last argument as keywordActive
这些协会是:rolify strict: true # strict means you get true only on a role that you manually addclass User < ApplicationRecord :optional => true
validates :resource_ty
在严格的模式下,我使用Rolify宝石来赋予用户角色。即(的严格模式) rolify strict: true本质上,我希望具有角色工程师的用户能够对作业类拥有特定的权限,但不一定对特定的职务具有权限但是当我尝试做一个类级rolify调用时User.with_role(:engineer, job)
# => [ list of User instances that have