Passed
Push — master ( 33ca92...23b088 )
by Ahmad
10:28
created

AddPasswordToRooms.change()   A

Complexity

Conditions 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 11
rs 9.85
c 0
b 0
f 0
1
# frozen_string_literal: true
2
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