instance method
inverse_of
Ruby on Rails edge
Since v4.0.13 Private — implementation detail, not part of the public APISignature
inverse_of(command, args, kwargs, &block)
No documentation comment.
Parameters
-
commandreq -
argsreq -
kwargsreq -
blockblock
Source
# File activerecord/lib/active_record/migration/command_recorder.rb, line 129
def inverse_of(command, args, kwargs, &block)
method = :"invert_#{command}"
raise IrreversibleMigration, <<~MSG unless respond_to?(method, true)
This migration uses #{command}, which is not automatically reversible.
To make the migration reversible you can either:
1. Define #up and #down methods in place of the #change method.
2. Use the #reversible method to define reversible behavior.
MSG
send(method, args, kwargs, &block)
end
Defined in activerecord/lib/active_record/migration/command_recorder.rb line 129
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Migration::CommandRecorder