Class: Baza::ForeignKey
- Inherits:
-
Object
- Object
- Baza::ForeignKey
- Includes:
- DatabaseModelFunctionality
- Defined in:
- lib/baza/foreign_key.rb
Direct Known Subclasses
Driver::Mysql::ForeignKey, Driver::Pg::ForeignKey, Driver::Sqlite3::ForeignKey
Instance Attribute Summary collapse
-
#column_name ⇒ Object
readonly
Returns the value of attribute column_name.
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#referenced_column_name ⇒ Object
readonly
Returns the value of attribute referenced_column_name.
-
#referenced_table_name ⇒ Object
readonly
Returns the value of attribute referenced_table_name.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
Methods included from DatabaseModelFunctionality
Instance Attribute Details
#column_name ⇒ Object (readonly)
Returns the value of attribute column_name.
4 5 6 |
# File 'lib/baza/foreign_key.rb', line 4 def column_name @column_name end |
#db ⇒ Object (readonly)
Returns the value of attribute db.
4 5 6 |
# File 'lib/baza/foreign_key.rb', line 4 def db @db end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/baza/foreign_key.rb', line 4 def name @name end |
#referenced_column_name ⇒ Object (readonly)
Returns the value of attribute referenced_column_name.
4 5 6 |
# File 'lib/baza/foreign_key.rb', line 4 def referenced_column_name @referenced_column_name end |
#referenced_table_name ⇒ Object (readonly)
Returns the value of attribute referenced_table_name.
4 5 6 |
# File 'lib/baza/foreign_key.rb', line 4 def referenced_table_name @referenced_table_name end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
4 5 6 |
# File 'lib/baza/foreign_key.rb', line 4 def table_name @table_name end |
Instance Method Details
#column ⇒ Object
6 7 8 |
# File 'lib/baza/foreign_key.rb', line 6 def column @_column ||= table.column(column_name) end |
#table ⇒ Object
10 11 12 |
# File 'lib/baza/foreign_key.rb', line 10 def table @_table ||= db.tables[table_name] end |
#to_param ⇒ Object
14 15 16 |
# File 'lib/baza/foreign_key.rb', line 14 def to_param name end |