From f13d31c37c93cabdb61c1de010af6ad134e2ec6f Mon Sep 17 00:00:00 2001 From: yui-knk Date: Fri, 28 Aug 2015 19:17:06 +0900 Subject: Add detailed error message to `IrreversibleMigration` --- Gemfile.lock | 4 ++++ activerecord/lib/active_record/migration/command_recorder.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ae2f00df2e..0bb7ee8af3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -202,6 +202,10 @@ GEM mysql2 (0.3.19) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) + nokogiri (1.6.6.2-x64-mingw32) + mini_portile (~> 0.6.0) + nokogiri (1.6.6.2-x86-mingw32) + mini_portile (~> 0.6.0) pg (0.18.2) psych (2.0.15) que (0.10.0) diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb index ab5a4cad89..6a0539e938 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, "#{method} is not defined, so #{command} is not reversible" unless respond_to?(method, true) + raise IrreversibleMigration, "This migration uses #{command} that is not automatically reversible, please define down method" unless respond_to?(method, true) send(method, args, &block) end -- cgit v1.2.3