Working with legacy database here, can't change the tables.
Have two tables. Lets say User
and Admin
. They both have user_id
which is a string, and the case varies between the tables. I can pull out records by doing donwcase
but its a manual query with no fancy ActiveRecord assosiation goods
How can I connect the two models?
I know that you can supply lambda to has_one
and belongs_to
, except it is used to narrow down the search, not to replace the AR generated one.
I am considering creating views on those tables and lowering the user_id
in them. That could work if I dont figure out how to get this going