+1 from me as well. This would be a great addition to the current API. Cheers, -- Yves Senn
On 10.04.2014, at 18:41, Rafael Mendonça França <rafaelmfra...@gmail.com> wrote: > +1, too. > > I was planning to add this method because calling `to_sql` is not a good > solution. I think the name we choose was `select_all`. > > Rafael Mendonça França > http://twitter.com/rafaelfranca > https://github.com/rafaelfranca > > > On Thu, Apr 10, 2014 at 1:03 PM, Dheeraj Kumar <a.dheeraj.ku...@gmail.com> > wrote: > +1, I do this a lot. > > On Apr 10, 2014 9:30 PM, "Evgeniy Sokovikov" <skv040...@gmail.com> wrote: > Hello. Is it possible to get raw sql query result from ActiveRecord::Relation > ? > > > > > Now I can make it this way: > > sql = Note.select('count(*), commit_id').group(:commit_id).to_sql > > > > ActiveRecord::Base.connection.execute(sql).to_a > > > > > > > > I would like something like this: > > > Note.select('count(*), commit_id').group(:commit_id).raw > > > > > > > > But didn't find such 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 http://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/d/optout. > > -- > 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 http://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/d/optout. > > > -- > 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 http://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/d/optout. -- 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 http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.