Permalink
Browse files

Added proper calls to reset_column_information in the migrations

  • Loading branch information...
1 parent e9d9002 commit c2957c58966990990759462bef4a47ab31809837 @rocksolidwebdesign rocksolidwebdesign committed Apr 5, 2011
@@ -1,6 +1,8 @@
class AddValueTypeToRefinerySettings < ActiveRecord::Migration
def self.up
add_column ::RefinerySetting.table_name, :form_value_type, :string
+
+ ::RefinerySetting.reset_column_information
end
def self.down
@@ -10,6 +10,8 @@ def self.up
rename_column ::User.table_name, :crypted_password, :encrypted_password
rename_column ::User.table_name, :login, :username
+
+ ::User.reset_column_information
end
def self.down
@@ -3,6 +3,8 @@ def self.up
if ::Page.column_names.map(&:to_s).include?('cached_slug')
remove_column ::Page.table_name, :cached_slug
end
+
+ ::Page.reset_column_information
end
def self.down
@@ -3,6 +3,8 @@ def self.up
add_column :slugs, :locale, :string, :limit => 5
add_index :slugs, :locale
+
+ ::Slug.reset_column_information
end
def self.down
@@ -1,6 +1,8 @@
class AddRememberCreatedAtToUsers < ActiveRecord::Migration
def self.up
add_column :users, :remember_created_at, :datetime
+
+ ::User.reset_column_information
end
def self.down
@@ -9,6 +9,8 @@ def self.up
end
end
+
+ ::Page.reset_column_information
end
def self.down
@@ -3,6 +3,8 @@ def self.up
::Page.translated_attribute_names.map(&:to_sym).each do |column_name|
remove_column ::Page.table_name, column_name if ::Page.column_names.map(&:to_sym).include?(column_name)
end
+
+ ::Page.reset_column_information
end
def self.down
@@ -5,6 +5,8 @@ def self.up
User.all.each do |u|
u.update_attribute(:encrypted_password, u.encrypted_password[29..-1])
end
+
+ ::User.reset_column_information
end
def self.down

0 comments on commit c2957c5

Please sign in to comment.