Skip to content

Instantly share code, notes, and snippets.

@Vaysman
Created February 15, 2012 08:36
Show Gist options
  • Save Vaysman/1834468 to your computer and use it in GitHub Desktop.
Save Vaysman/1834468 to your computer and use it in GitHub Desktop.
class BlahBlah < ActiveRecord::Migration
def up
puts "Records: #{TestResult.count}\n"
Feature.destroy_all
TestResult.all.each do |e|
begin
e.update_attribute(:generated, nil)
rescue ActiveRecord::RecordInvalid => er
puts "###\nId: #{er.record.id}\n###\nErrors:\n\t#{er.record.errors.full_messages.join("\n")}\n"
end
end
end
def down
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment