GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#848)
by Ahmad
04:48
created

AddManageRoomRecordingsToPermissions.change()   A

Complexity

Conditions 1

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
dl 0
loc 16
rs 9.6
c 2
b 1
f 0
1
# frozen_string_literal: true
2
3
class MigrationProduct < ActiveRecord::Base
4
  self.table_name = :roles
5
end
6
7
class SubMigrationProduct < ActiveRecord::Base
8
  self.table_name = :role_permissions
9
end
10
11
class AddManageRoomRecordingsToPermissions < ActiveRecord::Migration[5.2]
12
  def change
13
    reversible do |dir|
14
      dir.up do
15
        MigrationProduct.all.each do |role|
16
          SubMigrationProduct.create(role_id: role.id, name: "can_manage_rooms_recordings",
17
            value: SubMigrationProduct.find_by(role_id: role.id, name: "can_manage_users").value, enabled: true)
18
        end
19
      end
20
21
      dir.down do
22
        MigrationProduct.all.each do |role|
23
          SubMigrationProduct.find_by(role_id: role.id, name: "can_manage_rooms_recordings").destroy
24
        end
25
      end
26
    end
27
  end
28
end
29