On Friday, February 21, 2020 at 1:31:34 PM UTC-8, Jake wrote: > > In the docs it says `Note that this method is not safe to use on many > adapters if you are running additional queries inside the provided block. > If you are running queries inside the block, use a separate thread or shard > inside paged_each.` > > Does this apply if you're updating a different model then what you're > iterating through? > > Ex. > > A.page_each do |row| > B.first(some_id: row.some_id).update(...) > end >
Yes. It applies to any queries sent to the database. Some adapters will work with such code, but many won't, and it is unwise to rely on the current behavior in a particular adapter, because it may change in any future version. 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/21bdadd5-f6fa-46f6-af93-92d08e28dec5%40googlegroups.com.
