Issue with declaring composite key in ROM


I was trying to follow the documentation to create a composite key for a relation.

The current setup is primary_key :job_id, :user_id

However, calling the primary_key only yields the job_id and does not return both values. I believe this is preventing me from updating and deleting by_pk

Please advise.


Do you use inferred schemas? As in schema(infer: true) in your relation?


Yes sir, I tried both using inferred schemas and without. Same result only one primary_key detected.

We were able to work around it after finding the view on line 67 of rom-sql/lib/rom/sql/relation.rb to customize it to read our composite keys.


Could you report an issue in rom-sql explaining what problems you had and how you worked around them? We should address it somehow