Total Complexity | 1 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | # frozen_string_literal: true |
||
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 |