method

invert_remove_foreign_key

Importance_0
v6.1.7.7 - Show latest stable - 0 notes - Class: CommandRecorder
invert_remove_foreign_key(args) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/migration/command_recorder.rb, line 238
        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
Register or log in to add new notes.