I tried it, it works! thanks!  When do you think it will make it into next 
release?

On Thursday, June 8, 2017 at 9:54:57 PM UTC-7, Jeremy Evans wrote:
>
> On Monday, June 5, 2017 at 10:12:14 AM UTC-7, Jeremy Evans wrote:
>>
>> On Monday, June 5, 2017 at 1:52:45 AM UTC-7, Aryk Grosz wrote:
>>>
>>> I have a very similar example to this:
>>>
>>> https://groups.google.com/d/msg/sequel-talk/muJ14cXsnpA/YK1eV65-5qYJ
>>>
>>> You propose to solve it with this:
>>>
>>> Artist.many_to_many :songs, :join_table=>:albums, :right_key=>:id, 
>>> :right_primary_key=>:album_id
>>>
>>>
>>> This works for the normal usages like
>>>
>>> artist.songs
>>>
>>> However, if you do
>>>
>>> artist.song_pks, it will not return the correct values. I believe it 
>>> tries to get the values off the intermediary table (like as if it were a 
>>> real join table, which it isn't) and that's what is causing the issues 
>>> since it actually needs to join over to the songs table via the album_id 
>>> field and then look up the primary keys on that table.
>>>
>>> Or maybe I'm missing something?
>>>
>>
>> You aren't missing something, it doesn't work for that use case as it 
>> assumes that right_key in the join table contains the necessary values.  In 
>> order to support this case, we'd need to support an additional association 
>> option that specified the associated model table needs to be joined to and 
>> the primary key for the association model table used.
>>
>>
> I've added a commit that should address this need: 
> https://github.com/jeremyevans/sequel/commit/d6ea2d90250f2db37f884bcfac042354faca3d32
>
> Please try it out and let me know if it works for you.
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to