diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-18 15:12:09 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-19 10:24:15 -0800 |
commit | 96b50a039276b4391ddf07b0a74850ce7bad6863 (patch) | |
tree | a1bb5eff45e86cbbe78639883c885ccee1f9d147 /activerecord/lib/active_record | |
parent | b29a24bb6f13b8af9c12b77ee0ddc1f84c79ab55 (diff) | |
download | rails-96b50a039276b4391ddf07b0a74850ce7bad6863.tar.gz rails-96b50a039276b4391ddf07b0a74850ce7bad6863.tar.bz2 rails-96b50a039276b4391ddf07b0a74850ce7bad6863.zip |
IrreversibleMigration is raised if we cannot invert the command
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/migration/command_recorder.rb | 6 |
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 73450c2390..87ad603c04 100644 --- a/activerecord/lib/active_record/migration/command_recorder.rb +++ b/activerecord/lib/active_record/migration/command_recorder.rb @@ -20,7 +20,11 @@ module ActiveRecord # Returns a list that represents commands that are the inverse of the # commands stored in +commands+. def inverse - @commands.reverse.map { |name, args| send(:"invert_#{name}", args) } + @commands.reverse.map { |name, args| + method = :"invert_#{name}" + raise IrreversibleMigration unless respond_to?(method, true) + send(method, args) + } end private |