diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-08 17:49:31 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-08 17:49:31 +0000 |
commit | 9053c4c83e4ff74e71b7e771a0b58a3cb45e53bc (patch) | |
tree | 7460c3b9ea8e5106ea784c9d4ece0d2a696e5cce /activerecord | |
parent | 3c3d936f4d026336479c5ea0e953b8dcc823fbbd (diff) | |
download | rails-9053c4c83e4ff74e71b7e771a0b58a3cb45e53bc.tar.gz rails-9053c4c83e4ff74e71b7e771a0b58a3cb45e53bc.tar.bz2 rails-9053c4c83e4ff74e71b7e771a0b58a3cb45e53bc.zip |
Added documentation for #1904
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 5bfa00c19a..6f9b0ee2b4 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -120,6 +120,21 @@ module ActiveRecord # execute "ALTER TABLE `pages_linked_pages` DROP INDEX `page_id_linked_page_id`" # end # end + # + # == Using the class after changing table + # + # Some times you'll want to add a column in a migration and populate it immediately after. In that case, you'll need + # to make a call to Base#reset_column_information in order to ensure that the class has the latest column data from + # after the new column was added. Example: + # + # class MakeJoinUnique < ActiveRecord::Migration + # def self.up + # add_column :people, :salary, :integer + # Person.find(:all).each do |p| + # p.salary = SalaryCalculator.compute(p) + # end + # end + # end class Migration class << self def up() end |