I have a web interface which is using a database for its contents. The database is pretty much arbitrarily designed without following any standard.
I want to write some APIs on top of this database. My front-end is going to consume these APIs.
I am using ActiveRecord as the ORM. The problem is that I am unable to define any associations or joins on my existing tables as both of these operations expect a column named id in the referenced table.
What’s the way to go about it given that I don’t want to temper my existing database schema?
When you define associations you can use additional options like :foreign_key and :primary_key to specify details about such field names.