From 96b50a039276b4391ddf07b0a74850ce7bad6863 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 18 Nov 2010 15:12:09 -0800 Subject: IrreversibleMigration is raised if we cannot invert the command --- activerecord/lib/active_record/migration/command_recorder.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') 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 -- cgit v1.2.3