aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-06-28 12:05:19 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-06-28 12:05:19 -0700
commit941d5c1f4051416e1b7993374343e343027978a7 (patch)
treee24187f402a1247cda71b7d92295bf443a0d0877 /activerecord/lib/active_record
parenta5cb5a5af611481e7a69b160983fcac68f37088c (diff)
parentc278a2c5e109204ec8a47fcbfdfc327aad7996ce (diff)
downloadrails-941d5c1f4051416e1b7993374343e343027978a7.tar.gz
rails-941d5c1f4051416e1b7993374343e343027978a7.tar.bz2
rails-941d5c1f4051416e1b7993374343e343027978a7.zip
Merge pull request #1857 from vijaydev/irreversible-migration
IrreversibleMigration is not raised when a method not supported by reversible migrations is called in the change method of a migration
Diffstat (limited to 'activerecord/lib/active_record')
-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