Hi,
My tables are as follows:
“tblusers” - primary key “TblUsersID”
“tblregisteredphones” - primary key “TblRegisteredPhonesID”
- foreign key “intUserID”
My models are as follows:
class Registeredphone < ActiveRecord::Base
set_table_name “tblregisteredphones”
belongs_to :user,
:foreign_key => “intUserID”
set_primary_key(:TblRegisteredPhonesID)
end
class User < ActiveRecord::Base
set_table_name “tblusers”
has_many :registeredphones,
:foreign_key => “TblUsersID”
set_primary_key(:TblUsersID)
end
Is this correct?
Thanks,
Alana