ref: master
db/migrate/20130711213046_add_manage_environment_trusted_sites_to_admin_role.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
class AddManageEnvironmentTrustedSitesToAdminRole < ActiveRecord::Migration def self.up Environment.all.map(&:id).each do |id| role = Environment::Roles.admin(id) role.permissions << 'manage_environment_trusted_sites' role.save! end end def self.down Environment.all.map(&:id).each do |id| role = Environment::Roles.admin(id) role.permissions -= ['manage_environment_trusted_sites'] role.save! end end end |