| Total Complexity | 1 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # frozen_string_literal: true |
||
| 3 | class AddPasswordToRooms < ActiveRecord::Migration[5.0] |
||
| 4 | def change |
||
| 5 | add_column :rooms, :moderator_pw, :string |
||
| 6 | add_column :rooms, :attendee_pw, :string |
||
| 7 | Room.reset_column_information |
||
| 8 | Room.all.each do |room| |
||
| 9 | room.update_attributes!( |
||
| 10 | moderator_pw: RandomPassword.generate(length: 12), |
||
| 11 | attendee_pw: RandomPassword.generate(length: 12) |
||
| 12 | ) |
||
| 13 | end |
||
| 14 | end |
||
| 15 | end |
||
| 16 |