summaryrefslogtreecommitdiffstats
path: root/db/migrate/20221214173537_add_select_project_publicity_permission.rb
blob: aed1b07d1291e0097b15f13c7e7a6c3327e64595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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

  def run_in_request?; true end
end