Class: Peegee::ForeignKey

Inherits:
Constraint show all
Defined in:
lib/peegee/foreign_key.rb

Instance Method Summary collapse

Methods inherited from Constraint

#create, #drop

Constructor Details

#initialize(opts) ⇒ ForeignKey

Returns a new instance of ForeignKey.



4
5
6
# File 'lib/peegee/foreign_key.rb', line 4

def initialize(opts)
  super(opts)
end

Instance Method Details

#foreign_key_nameObject

Returns the name of this foreign key.



9
10
11
# File 'lib/peegee/foreign_key.rb', line 9

def foreign_key_name
  @constraint_name
end

#to_sObject

Returns human readable foreign key definition



14
15
16
# File 'lib/peegee/foreign_key.rb', line 14

def to_s
  "Foreign Key: #{foreign_key_name} on #{table_name}"
end