Hello,
I have a situation where the foreign key into a table doesn’t
correspond to that table’s primary key:
my_table
id (pk)
name
…
other_table
id (pk)
my_table_name (fk references my_table(name))
…
I want to be able to say something like:
class OtherTable < ActiveRecord::Base
belongs_to :my_table, :foreign_key => { :my_table_name => :name }
end
OtherTable.find(:first).my_table
Is this possible? If not, what is the reasoning behind the decision?
Thanks.