aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration/command_recorder.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2011-06-25 00:01:59 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2011-06-25 17:17:02 +0530
commitc278a2c5e109204ec8a47fcbfdfc327aad7996ce (patch)
tree9aa75fd3a1a81f42aedfdc3786165cc40f5f4f1b /activerecord/lib/active_record/migration/command_recorder.rb
parent7e56bf724479ce92eff2f806573f382957f3a2b4 (diff)
downloadrails-c278a2c5e109204ec8a47fcbfdfc327aad7996ce.tar.gz
rails-c278a2c5e109204ec8a47fcbfdfc327aad7996ce.tar.bz2
rails-c278a2c5e109204ec8a47fcbfdfc327aad7996ce.zip
record unsupported methods in CommandRecorder instead of letting the unsupported methods go through to the underlying db causing errors like duplicate columns to occur when rolling back migrations
Diffstat (limited to 'activerecord/lib/active_record/migration/command_recorder.rb')
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb
index f01e94169f..d06e050db3 100644
--- a/activerecord/lib/active_record/migration/command_recorder.rb
+++ b/activerecord/lib/active_record/migration/command_recorder.rb
@@ -93,11 +93,11 @@ module ActiveRecord
[:remove_timestamps, args]
end
- # Forwards any missing method call to the \target.
+ # Record all the methods called in the +change+ method of a migration.
+ # 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)
- @delegate.send(method, *args, &block)
- rescue NoMethodError => e
- raise e, e.message.sub(/ for #<.*$/, " via proxy for #{@delegate}")
+ record(method, args)
end
end