Class: PGTrunk::Operations::ForeignKeys::Base Abstract

Inherits:
PGTrunk::Operation show all
Defined in:
lib/pg_trunk/operations/foreign_keys/base.rb

Overview

This class is abstract.

Base class for operations with foreign keys

Direct Known Subclasses

AddForeignKey, DropForeignKey, RenameForeignKey

Instance Method Summary collapse

Methods included from PGTrunk::Operation::SQLHelpers

#quote

Methods included from PGTrunk::Operation::RubyHelpers

#dump, #to_a, #to_opts, #to_ruby

Methods included from PGTrunk::Operation::Inversion

#invert!, #irreversible!

Methods included from PGTrunk::Operation::Validations

#error_messages

Methods included from PGTrunk::Operation::Attributes

#attributes, #initialize

Instance Method Details

#<=>(other) ⇒ Object

By default foreign keys are sorted by tables and names.



33
34
35
36
37
38
# File 'lib/pg_trunk/operations/foreign_keys/base.rb', line 33

def <=>(other)
  return unless other.is_a?(self.class)

  result = table <=> other.table
  result.zero? ? super : result
end