Class: Peegee::ForeignKey
- Inherits:
-
Constraint
- Object
- Constraint
- Peegee::ForeignKey
- Defined in:
- lib/peegee/foreign_key.rb
Instance Method Summary collapse
-
#foreign_key_name ⇒ Object
Returns the name of this foreign key.
-
#initialize(opts) ⇒ ForeignKey
constructor
A new instance of ForeignKey.
-
#to_s ⇒ Object
Returns human readable foreign key definition.
Methods inherited from Constraint
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_name ⇒ Object
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_s ⇒ Object
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 |