Re: [Rails-core] Feature proposal: Use find_each/find_in_batches with pluck

2015-08-16 Thread Kevin Deisz
By the way, with the new in_batches API you can do this. a la User.some_scopes.in_batches.each do |users| users.pluck(:id) end On Wed, Jul 22, 2015 at 6:44 AM, Fernando Tapia Rico fertap...@gmail.com wrote: +1 On Friday, June 19, 2015 at 2:35:30 PM UTC+2, Paco Guzmán wrote: Yes, that

Re: [Rails-core] Feature proposal: Use find_each/find_in_batches with pluck

2015-07-22 Thread Fernando Tapia Rico
+1 On Friday, June 19, 2015 at 2:35:30 PM UTC+2, Paco Guzmán wrote: Yes, that our use case too, and as you said we wanted to avoid the AR objects overhead El domingo, 14 de junio de 2015, 22:14:18 (UTC+2), George Ogata escribió: +1 I find one of the most frequent uses of

Re: [Rails-core] Feature proposal: Use find_each/find_in_batches with pluck

2015-06-19 Thread Paco Guzmán
Yes, that our use case too, and as you said we wanted to avoid the AR objects overhead El domingo, 14 de junio de 2015, 22:14:18 (UTC+2), George Ogata escribió: +1 I find one of the most frequent uses of find_each/find_in_batches is looping through a large collection in order to queue up a

[Rails-core] Feature proposal: Use find_each/find_in_batches with pluck

2015-06-14 Thread Paco Guzmán
I would like to provide a new feature on Rails that consist on the use of pluck when using find_each/find_in_batches to speed up the loop when is not need to access to active record instances. Do you think this could be incorporated in Rails? For the moment I'm going to implement a solution

Re: [Rails-core] Feature proposal: Use find_each/find_in_batches with pluck

2015-06-14 Thread Vipul A M
Can you share an example of this proposal? Vipul A.M. +91-8149-204995 On Sun, Jun 14, 2015 at 11:26 PM, Paco Guzmán pacoguzm...@gmail.com wrote: I would like to provide a new feature on Rails that consist on the use of pluck when using find_each/find_in_batches to speed up the loop when is

Re: [Rails-core] Feature proposal: Use find_each/find_in_batches with pluck

2015-06-14 Thread George Ogata
+1 I find one of the most frequent uses of find_each/find_in_batches is looping through a large collection in order to queue up a list of ids for a background job to process. e.g. queuing up a big list of user ids to send an email to. Would be nice to avoid the overhead of AR objects and just do