Skip to content

Commit

Permalink
Update initializer.rb to include the remove_role_if_empty option and …
Browse files Browse the repository at this point in the history
…description

The default action is to remove roles if the last resource is removed. Important to disable this if the roles are associated with permissions (Pundit etc.) and cascades are enabled.

I'd suggest changing the default action, but in absence of that, a small change to the initializer to include the option and description to change it.
  • Loading branch information
ethier committed Apr 10, 2016
1 parent 2a61bcb commit 4386aa1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/generators/rolify/templates/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@

# Dynamic shortcuts for User class (user.is_admin? like methods). Default is: false
# config.use_dynamic_shortcuts
end

# Configuration to remove roles from database once the last resource is removed. Default is: true
# config.remove_role_if_empty = false
end

0 comments on commit 4386aa1

Please sign in to comment.