I have two tables:
I would like to specify a has_one mapping from table_1 to table_2 but
specifying that the join is based on (table_2.tab2_id =
I am half way there with:
class Table1 < ActiveRecord::Base
has_one :Table2, :class_name => “Table2”, :foreign_key => “tab2_id”
However, as you can see, this will join on table_2.tab2_id =
table1_1.tab1_id and not on table_1.other_id.
Is there a notation that I am missing to express this, or is there
another way of acheiving this. I cannot alter the DB schema.
Thanks in anticipation.