Skip to content

Instantly share code, notes, and snippets.

@bvandgrift
Created July 3, 2012 15:29
Show Gist options
  • Save bvandgrift/3040485 to your computer and use it in GitHub Desktop.
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/
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