aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-11-17 10:00:33 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-11-17 10:29:28 -0800
commit649f2513a453cae319be8b63a9de25ae11fb9e8f (patch)
treee82ffb4cdfa682083d5ef6b28248f6d81f3cfe41 /activerecord/lib/active_record/connection_adapters
parentd8b2b6a183020aaaacb901dd78ec2b901b119a0d (diff)
downloadrails-649f2513a453cae319be8b63a9de25ae11fb9e8f.tar.gz
rails-649f2513a453cae319be8b63a9de25ae11fb9e8f.tar.bz2
rails-649f2513a453cae319be8b63a9de25ae11fb9e8f.zip
Revert "Merge pull request #3603 from vijaydev/change_table_without_block_arg"
This reverts commit 81fad6a270ec3cbbb88553c9f2e8200c34fd4d13, reversing changes made to 23101de283de13517e30c4c3d1ecc65525264886. Conflicts: activerecord/test/cases/migration_test.rb
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 7742f32213..1d837f29be 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -242,19 +242,14 @@ module ActiveRecord
#
# See also Table for details on
# all of the various column transformation
- def change_table(table_name, options = {}, &blk)
- bulk_change = supports_bulk_alter? && options[:bulk]
- recorder = bulk_change ? ActiveRecord::Migration::CommandRecorder.new(self) : self
- table = Table.new(table_name, recorder)
-
- if block_given?
- if blk.arity == 1
- yield table
- else
- table.instance_eval(&blk)
- end
+ def change_table(table_name, options = {})
+ if supports_bulk_alter? && options[:bulk]
+ recorder = ActiveRecord::Migration::CommandRecorder.new(self)
+ yield Table.new(table_name, recorder)
+ bulk_change_table(table_name, recorder.commands)
+ else
+ yield Table.new(table_name, self)
end
- bulk_change_table(table_name, recorder.commands) if bulk_change
end
# Renames a table.