Module: Resourcify::DataMapper::Parents
- Defined in:
- lib/resourcify/data_mapper/parents.rb
Instance Method Summary collapse
-
#parent_keys ⇒ Object
FIXME Only works for single-field foreign keys.
-
#parent_relationships ⇒ Object
FIXME Not grabbing proper relationships.
Instance Method Details
#parent_keys ⇒ Object
FIXME Only works for single-field foreign keys
6 7 8 |
# File 'lib/resourcify/data_mapper/parents.rb', line 6 def parent_keys parent_relationships.keys end |
#parent_relationships ⇒ Object
FIXME Not grabbing proper relationships
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/resourcify/data_mapper/parents.rb', line 11 def parent_relationships parent_relationships = {} relationships.each do |relationship_name, relationship| if relationship.child_model == self parent_key = relationship.child_key.entries.first.field.to_sym parent_relationships[parent_key] = relationship end end parent_relationships end |