cirandas.net

ref: master

db/migrate/051_add_edit_appearance_permission.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
class AddEditAppearancePermission < ActiveRecord::Migration

  def self.up
    [ Profile::Roles.admin, Environment::Roles.admin].compact.each do |item|
      item.permissions += [ 'edit_appearance' ]
      item.save!
    end
  end

  def self.down
    [ Profile::Roles.admin, Environment::Roles.admin].compact.each do |item|
      item.permissions -= [ 'edit_appearance' ]
      item.save!
    end
  end
end