Thanks for the explanation. That makes sense. Your use cases is certainly valid but I'm on the fence whether this should be in Active Record. It should be possible to extract boundaries using #in_batches and #where_values_hash:
relation.in_batches do |relation| min_id, max_id = relation.where_values_hash['id'].minmax # Do something with the boundaries. end I'm not sure whether that warrants a separate method. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at https://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.