This project is archived and is in readonly mode.
has_many :through with custom primary keys
-
Justin Marney
for more discussion see: http://www.ruby-forum.com/topic/...
-
Justin Marney
IGNORE THE ABOVE LINK
Sorry pasted the wrong link. Go HERE http://www.ruby-forum.com/topic/... for more discussion.
-
Peter Liu
I have the same problem and have been pulling my hair out for days. It is a bug and your patch fixed it. I'm still new so I don't know how to apply the patch so I just manually changed that one line and it work. Please include this patch in 2.2.
-
Tim Pope
I should have searched for tickets first as I've solved this independently. I'm attaching a patch because the original no longer applies cleanly. Both patches implement the same solution with tests and get a +1 from me.
-
Will Bryant
That looks better, but I think it may be still missing another possible case - if it goes through an association with a :primary_key option (eg. has_many :bikes, :primary_key => 'my_special_id'; has_many :spokes, :through => :bikes)?
-
Repository
- State changed from new to resolved
(from [1e6c50e21bdb8c99116a7dc6921ef3eb4ed9531a]) Ensure has_many :through works with changed primary keys [#736 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
