On Saturday, May 30, 2020 at 4:58:47 AM UTC-7, Aryk Grosz wrote:
>
> Often times, I want to return the IDs from an association only to use it 
> in another query.
>
> For example, say you have a many to many like User has many Books.
>
> With association_pks plugin, you can do user.book_pks and get back an 
> actual array, but if you are returning potentially 300 IDs and then 
> throwing that into another query, that query will get unnecesarily long 
> (imagine repeating this a few times).
>
> I noticed that in the association_pks plugin, you are running select_map 
> on all your datasets. Perhaps at that last step, we could simple "select' 
> that column and create a new method <association>_pks_dataset to just 
> return the dataset. 
>
> It wouldn't add a lot of new code/logic, but increase flexibility of that 
> plugin.
>
> Thoughts?
>

This seems like a useful feature addition, I'll add it to my todo list.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/1cac6d31-52f3-4a4c-8fc1-be9a6375382c%40googlegroups.com.

Reply via email to