Created
July 3, 2012 15:29
-
-
Save bvandgrift/3040485 to your computer and use it in GitHub Desktop.
seed roles for declarative_authorization based on config/authorization_rules.rb. store in lib/seeds/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Role.delete_all | |
role_names = Authorization::Engine.instance.roles | |
role_names.each { |name| Role.find_or_create_by_name!(name) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment