From ca5f7aca912b2548ff0457d964cf93c9bcea5a7b Mon Sep 17 00:00:00 2001 From: Dhruv Kapadia Date: Thu, 27 May 2010 12:31:04 -0400 Subject: [PATCH] Fix migration error that will cause first time migrate to fail --- db/migrate/20100517153944_add_missing_response_time_exp_to_votes.rb | 4 ++++ 1 file changed, 4 insertions(+), 0 deletions(-) diff --git a/db/migrate/20100517153944_add_missing_response_time_exp_to_votes.rb b/db/migrate/20100517153944_add_missing_response_time_exp_to_votes.rb index 328f45f..8f9d750 100644 --- a/db/migrate/20100517153944_add_missing_response_time_exp_to_votes.rb +++ b/db/migrate/20100517153944_add_missing_response_time_exp_to_votes.rb @@ -3,7 +3,11 @@ class AddMissingResponseTimeExpToVotes < ActiveRecord::Migration add_column :votes, :missing_response_time_exp, :string, :default => "" add_column :skips, :missing_response_time_exp, :string, :default => "" + begin recording_client_time_start_date = Vote.find(:all, :conditions => 'time_viewed IS NOT NULL', :order => 'created_at', :limit => 1).first.created_at + rescue + recording_client_time_start_date = nil + end Vote.find_each do |v| if v.created_at <= recording_client_time_start_date && v.time_viewed.nil? v.missing_response_time_exp = "missing" -- libgit2 0.21.2