Permalink
Browse files

Added reset_column_information calls to appropriate self.down methods…

… in the migrations, small namespace fix for a missing :: prefix
  • Loading branch information...
1 parent c2957c5 commit 598f85c57e309170e382254d0abbcadae22fc10a @rocksolidwebdesign rocksolidwebdesign committed Apr 5, 2011
@@ -7,5 +7,7 @@ def self.up
def self.down
remove_column ::RefinerySetting.table_name, :form_value_type
+
+ ::RefinerySetting.reset_column_information
end
end
@@ -25,5 +25,7 @@ def self.down
rename_column ::User.table_name, :encrypted_password, :crypted_password
rename_column ::User.table_name, :username, :login
+
+ ::User.reset_column_information
end
end
@@ -11,5 +11,7 @@ def self.down
remove_column :slugs, :locale
remove_index :slugs, :locale
+
+ ::Slug.reset_column_information
end
end
@@ -7,5 +7,7 @@ def self.up
def self.down
remove_column :users, :remember_created_at
+
+ ::User.reset_column_information
end
end
@@ -10,7 +10,7 @@ def self.up
end
- ::Page.reset_column_information
+ ::Page::Translation.reset_column_information
end
def self.down
@@ -24,5 +24,7 @@ def self.down
end
remove_column ::Page::Translation.table_name, :custom_title
+
+ ::Page::Translation.reset_column_information
end
end
@@ -11,5 +11,7 @@ def self.down
::Page.translated_attribute_names.map(&:to_sym).each do |column_name|
add_column ::Page.table_name, column_name, Page::Translation.columns.detect{|c| c.name.to_sym == column_name}.type
end
+
+ ::Page.reset_column_information
end
end
@@ -2,7 +2,7 @@ class RemovePasswordSaltFromUsers < ActiveRecord::Migration
def self.up
remove_column :users, :password_salt
# Make the current password invalid :(
- User.all.each do |u|
+ ::User.all.each do |u|
u.update_attribute(:encrypted_password, u.encrypted_password[29..-1])
end
@@ -11,5 +11,7 @@ def self.up
def self.down
add_column :users, :password_salt, :string
+
+ ::User.reset_column_information
end
end

0 comments on commit 598f85c

Please sign in to comment.