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