diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2011-12-09 10:33:37 +0100 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2011-12-09 10:33:37 +0100 |
commit | 255d9f5ac1f2afa5a293a4b45d3aa17a31da46bf (patch) | |
tree | a597937011b3e7359d630aa3616bdea220a3515c | |
parent | 5ad52152117ecda1166359c499bcd03ae6be3365 (diff) | |
download | rails-255d9f5ac1f2afa5a293a4b45d3aa17a31da46bf.tar.gz rails-255d9f5ac1f2afa5a293a4b45d3aa17a31da46bf.tar.bz2 rails-255d9f5ac1f2afa5a293a4b45d3aa17a31da46bf.zip |
String#to_a is not available in 1.9
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index f0dca080c0..96e68b6c88 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -503,7 +503,7 @@ module ActiveRecord def remove_origin_comment(migration_source) if migration_source =~ /^# This migration comes from/ - migration_source = migration_source.to_a[1..-1].join + migration_source = migration_source.lines.to_a[1..-1].join end migration_source diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index fb49dccbd3..e27a1ff535 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -2258,7 +2258,7 @@ if ActiveRecord::Base.connection.supports_migrations? # remove origin comment migration = @migrations_path + "/4_people_have_hobbies.rb" - migration_source = File.read(migration).to_a[1..-1].join + migration_source = File.read(migration).lines.to_a[1..-1].join File.open(migration, "w") { |f| f.write migration_source } ActiveRecord::Migration.copy(@migrations_path, sources, :on_skip => on_skip) |