On 4 February 2016 at 15:54, nanaya <m...@0paste.com> wrote: > > > On Fri, Feb 5, 2016, at 00:50, Colin Law wrote: >> You don't need the first two lines, you just need something like >> Initiative.all.map {|initiative| [initiative.name, >> initiative.trainings.count] }
Who cares? Always initially write the simplest code that will do the job, do not indulge in premature optimisation. The simplest code is less likely to be buggy which is much more important than saving a couple of milliseconds. Later if it is shown that there are throughput issues then one can work out where the bottlenecks are and refactor. Several decades of s/w development have shown me that the bottlenecks in the code are most unlikely to be in the areas you expect (unless you are much better at it than I am) so it is much better to adopt the KISS principle at first development, that way you will get something working more quickly and with fewer bugs. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtCzBxjjWgvsp%2B0ebfJyKgTUoVsk%3Dc7aq%3D%2BRO8E8Qg6yA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.