skill-assessment-app/db/migrate/20161204220527_add_completed_at.rb
2016-12-04 16:41:07 -06:00

13 lines
355 B
Ruby

# frozen_string_literal: true
class AddCompletedAt < ActiveRecord::Migration[5.0]
def change
add_column :candidates, :completed_at, :datetime, after: :completed
Candidate.reset_column_information
Candidate.where(completed: true).each do |candidate|
candidate.completed_at = candidate.updated_at
candidate.save
end
end
end