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

AddPasswordToRooms   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A change() 0 11 1
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