Conditions | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | class MigrationProduct < ActiveRecord::Base |
||
10 | def change |
||
11 | reversible do |dir| |
||
12 | dir.up do |
||
13 | MigrationProduct.all.each do |role| |
||
14 | SubMigrationProduct.create(role_id: role.id, name: "can_manage_rooms_recordings", value: SubMigrationProduct.find_by(role_id: role.id, name: "can_manage_users").value, enabled: true) |
||
15 | end |
||
16 | end |
||
17 | |||
18 | dir.down do |
||
19 | MigrationProduct.all.each do |role| |
||
20 | SubMigrationProduct.find_by(role_id: role.id, name: "can_manage_rooms_recordings").destroy |
||
21 | end |
||
22 | end |
||
23 | end |
||
24 | end |
||
25 | end |
||
26 |