rom-rb / rom-http

Abstract HTTP adapter for ROM
https://rom-rb.org
MIT License
73 stars 18 forks source link

Transform keys on insert and update #28

Closed maximderbin closed 7 years ago

maximderbin commented 7 years ago

Why? If we are using rom-http with rom-sql associate and have key renaming, associate will blow up trying to find primary_key in tuple as Relation#primary_key returns renamed key name but tuple has original

Look into source here: https://github.com/rom-rb/rom-sql/blob/master/lib/rom/sql/association/many_to_one.rb#L51

This PR Adding transformation to Relation#insert and Relation#update

AMHOL commented 7 years ago

Thanks @maximderbin

maximderbin commented 7 years ago

@AMHOL thanks for merging 👍