Displaying 1 result from an estimated 1 matches for "with_primary_key".
2008 Jan 21
13
has_many with different primary key
...integrating two systems. So, rather then using id
as the primary key for the relationship (as the above code would do) I
want to use other_company_id for the primary key. It''d be great if I
could do this:
class Company < ActiveRecord::Base
has_many :reviews, :as => :reviewable, :with_primary_key =>
:other_company_id
end
It would then use the other_company_id to lookup and create reviews.
Unfortunately, Rails has no such option.
There has to be someone else out there that has run into this
limitation. Thanks in advance for the help.
Gregg Pollack
RailsEnvy.com
--
Posted via http...