Module: RStore::HelperMethods
- Included in:
- Storage
- Defined in:
- lib/rstore/modules/helper_methods.rb
Instance Method Summary collapse
-
#p_key(schema) ⇒ Object
Calulate primary key from schema.
Instance Method Details
#p_key(schema) ⇒ Object
Calulate primary key from schema
7 8 9 10 11 |
# File 'lib/rstore/modules/helper_methods.rb', line 7 def p_key schema schema.map do |(col_name, col_properties)| col_name if col_properties[:primary_key] == true end.compact.first end |