From dfa54b369d071da661e92843c105ce8da17e1e38 Mon Sep 17 00:00:00 2001 From: Bryan Larsen Date: Wed, 31 Mar 2010 12:44:46 -0400 Subject: [PATCH] [#643] (comments) don't break migrations --- hobofields/lib/hobo_fields/field_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hobofields/lib/hobo_fields/field_spec.rb b/hobofields/lib/hobo_fields/field_spec.rb index 90c3d333e..9b2d85ecf 100644 --- a/hobofields/lib/hobo_fields/field_spec.rb +++ b/hobofields/lib/hobo_fields/field_spec.rb @@ -81,8 +81,12 @@ def different_to?(col_spec) # we should be able to use col_spec.comment, but col_spec has # a nil table_name for some strange reason. begin - col_comment = ActiveRecord::Base.try.column_comment(col_spec.name, model.table_name) - col_comment != nil && col_comment != comment + if model.table_exists? + col_comment = ActiveRecord::Base.try.column_comment(col_spec.name, model.table_name) + col_comment != nil && col_comment != comment + else + true + end end || begin check_attributes = [:null, :default]