Created
June 10, 2012 20:31
-
-
Save jdelStrother/2907225 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb | |
index a448e0a..6d3b0a8 100644 | |
--- a/activerecord/test/cases/migration_test.rb | |
+++ b/activerecord/test/cases/migration_test.rb | |
@@ -1708,6 +1708,18 @@ if ActiveRecord::Base.connection.supports_migrations? | |
end | |
end | |
+ def test_add_column_persists_values | |
+ Person.create! | |
+ | |
+ Person.connection.add_column :people, :favorite_food, :string | |
+ Person.find_each do |p| | |
+ p.favorite_food = "hotdogs" | |
+ p.save! | |
+ end | |
+ | |
+ assert_equal "hotdogs", Person.last.favorite_food | |
+ end | |
+ | |
protected | |
def with_env_tz(new_tz = 'US/Eastern') | |
old_tz, ENV['TZ'] = ENV['TZ'], new_tz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment