aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-06-30 00:47:35 +0100
committerJon Leighton <j@jonathanleighton.com>2011-06-30 00:47:35 +0100
commit4d256bc6b1e6ae62c78d0ff3ca17480a53e00436 (patch)
tree7314d625e609e4bfad30276c81c14e318b2ad29a /activerecord/lib/active_record/migration
parentb4d8c7d148c6b44eea6701687ca2a97df9088747 (diff)
downloadrails-4d256bc6b1e6ae62c78d0ff3ca17480a53e00436.tar.gz
rails-4d256bc6b1e6ae62c78d0ff3ca17480a53e00436.tar.bz2
rails-4d256bc6b1e6ae62c78d0ff3ca17480a53e00436.zip
CommandRecorder should delegate in method_missing where possible. Fixes some tests in migration_test.rb under mysql. The problem was introduced in c278a2c5e109204ec8a47fcbfdfc327aad7996ce.
Diffstat (limited to 'activerecord/lib/active_record/migration')
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb
index d06e050db3..4a01313c61 100644
--- a/activerecord/lib/active_record/migration/command_recorder.rb
+++ b/activerecord/lib/active_record/migration/command_recorder.rb
@@ -97,7 +97,11 @@ module ActiveRecord
# This will ensure that IrreversibleMigration is raised when the corresponding
# invert_method does not exist while the migration is rolled back.
def method_missing(method, *args, &block)
- record(method, args)
+ if delegate.respond_to?(method)
+ delegate.send(method, *args, &block)
+ else
+ record(method, args)
+ end
end
end