From 2cc49df85a4b0232a804944caead6f288a20ad26 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Fri, 28 Aug 2015 13:50:49 +0900 Subject: Add detailed error message to `IrreversibleMigration` --- activerecord/lib/active_record/migration/command_recorder.rb | 2 +- 1 file changed, 1 insertion(+), 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 b52e89d792..ab5a4cad89 100644 --- a/activerecord/lib/active_record/migration/command_recorder.rb +++ b/activerecord/lib/active_record/migration/command_recorder.rb @@ -69,7 +69,7 @@ module ActiveRecord # invert the +command+. def inverse_of(command, args, &block) method = :"invert_#{command}" - raise IrreversibleMigration unless respond_to?(method, true) + raise IrreversibleMigration, "#{method} is not defined, so #{command} is not reversible" unless respond_to?(method, true) send(method, args, &block) end -- cgit v1.2.3