summaryrefslogtreecommitdiffstats
path: root/db/migrate/20221214173537_add_select_project_publicity_permission.rb
blob: 7a0fee7c8a50fb74ef030dca1a7af7a5465c0ae4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
class AddSelectProjectPublicityPermission < ActiveRecord::Migration[6.1]
  def up
    Role.find_each do |r|
      r.add_permission!(:select_project_publicity) if r.permissions.include?(:edit_project)
    end
  end

  def down
    Role.find_each do |r|
      r.remove_permission!(:select_project_publicity)
    end
  end
end