How do i make ActiveRecord work on Tables with multiple columns as Primary keys?
-
03-07-2019 - |
Question
How do i use ActiveRecord on existing DB with multiple columns as primary key and no ID column? I had to write extensions/hacks on set_primary_key, update and delete methods. But im not sure if it'll work on future versions. Is there a way to make ActiveRecord work in such cases without hacks?
Solution
ActiveRecord doesn't support composite primary keys. Here is a library that purports to add support though.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow