method
invert_remove_foreign_key
rails latest stable - Class:
ActiveRecord::Migration::CommandRecorder
invert_remove_foreign_key(args)private
No documentation available.
# File activerecord/lib/active_record/migration/command_recorder.rb, line 279
def invert_remove_foreign_key(args)
options = args.extract_options!
from_table, to_table = args
to_table ||= options.delete(:to_table)
raise ActiveRecord::IrreversibleMigration, "remove_foreign_key is only reversible if given a second table" if to_table.nil?
reversed_args = [from_table, to_table]
reversed_args << options unless options.empty?
[:add_foreign_key, reversed_args]
end