aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2015-08-28 19:17:06 +0900
committeryui-knk <spiketeika@gmail.com>2015-08-28 19:17:06 +0900
commitf13d31c37c93cabdb61c1de010af6ad134e2ec6f (patch)
tree415b4e2f1c2781f1492feabd658c903b36907173
parent2cc49df85a4b0232a804944caead6f288a20ad26 (diff)
downloadrails-f13d31c37c93cabdb61c1de010af6ad134e2ec6f.tar.gz
rails-f13d31c37c93cabdb61c1de010af6ad134e2ec6f.tar.bz2
rails-f13d31c37c93cabdb61c1de010af6ad134e2ec6f.zip
Add detailed error message to `IrreversibleMigration`
-rw-r--r--Gemfile.lock4
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb2
2 files changed, 5 insertions, 1 deletions
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