From 0d7410faabaafc6cd64f636b22a450faedc732ca Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 18 Nov 2010 15:15:03 -0800 Subject: updating documentation --- activerecord/lib/active_record/migration/command_recorder.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb index 87ad603c04..8a98a177d5 100644 --- a/activerecord/lib/active_record/migration/command_recorder.rb +++ b/activerecord/lib/active_record/migration/command_recorder.rb @@ -18,7 +18,13 @@ module ActiveRecord end # Returns a list that represents commands that are the inverse of the - # commands stored in +commands+. + # commands stored in +commands+. For example: + # + # recorder.record(:rename_table, [:old, :new]) + # recorder.inverse # => [:rename_table, [:new, :old]] + # + # This method will raise an IrreversibleMigration exception if it cannot + # invert the +commands+. def inverse @commands.reverse.map { |name, args| method = :"invert_#{name}" -- cgit v1.2.3