Class: Dart::Reflection::SequelTable::ForeignKeyFinder
- Inherits:
-
Object
- Object
- Dart::Reflection::SequelTable::ForeignKeyFinder
- Defined in:
- lib/dart/reflection/sequel_table/foreign_key_finder.rb
Instance Method Summary collapse
-
#foreign_keys_for(relation, schema) ⇒ Array<ForeignKeyInfo>
Returns the set of foreign keys on the given relation based on foreign key constraints defined in the db.
Instance Method Details
#foreign_keys_for(relation, schema) ⇒ Array<ForeignKeyInfo>
Returns the set of foreign keys on the given relation based on foreign key constraints defined in the db
11 12 13 14 |
# File 'lib/dart/reflection/sequel_table/foreign_key_finder.rb', line 11 def foreign_keys_for(relation, schema) rows = schema.execute!(constraint_query(relation.table_name)) rows.all.map { |attrs| ForeignKeyInfo.from_hash(attrs) } end |