Got it. I would like to vote for adding it as an opt-in option on association_pks.
I often use it to get Ids to check against users returned in the API. For example: def user_blocked_by_current_user self.class.current_user.blocked_by_user_pks.include?(id) end Of course, this would run for every user so now I have to create another function that simply caches the blocked_by_user_pks result. On Tuesday, June 9, 2020 at 7:27:54 PM UTC+3, Jeremy Evans wrote: > > On Tuesday, June 9, 2020 at 8:56:28 AM UTC-7, Aryk Grosz wrote: >> >> Any reason why association_pks does not cache the pks the same way >> associations are cached? >> > > No particular reason, though nobody has asked for it before as far as I > can remember. Potentially, such caching could be added as a new plugin or > a plugin option to association_pks (or association option that > association_pks recognizes). It couldn't be made the default behavior as > it breaks backwards compatibility. > > 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/6cf61400-cc44-476e-aae0-94418ecf63d7o%40googlegroups.com.
