[Rails] Re: Relation count returns syntax error in Rails 4.1.X

2014-06-01 Thread Josh Jordan
Rails introduced a breaking change to select and count being used together in the same relation. Either remove your call to select, since it is unnecessary here, or call count(:all). More info here: https://github.com/rails/rails/issues/15138 On Saturday, May 31, 2014 8:00:36 PM UTC-4,

[Rails] Re: Relation count returns syntax error in Rails 4.1.X

2014-06-01 Thread Rodrigo Lueneberg
Josh, If I remove the call to select how to specify which columns to select? PS: You don't want Rails to select all using wildcard * as it will affect performance. Thanks Rod -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

Re: [Rails] Re: Relation count returns syntax error in Rails 4.1.X

2014-06-01 Thread josh.jor...@gmail.com
If you're calling count, it doesn't matter what select values you've passed, since you're asking ActiveRecord to return an aggregate, not any column values. On Sun, Jun 1, 2014 at 9:19 AM, Rodrigo Lueneberg li...@ruby-forum.com wrote: Josh, If I remove the call to select how to specify which

[Rails] Re: Relation count returns syntax error in Rails 4.1.X

2014-06-01 Thread Rodrigo Lueneberg
Thanks, I am glad we are on the same page. Sorry, I did not see your github post. I will check that right now. Rod -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group

[Rails] Re: Relation count returns syntax error in Rails 4.1.X

2014-06-01 Thread Rodrigo Lueneberg
By the way what would be more efficient, count(:all) or count(1)? thanks Rod -- Posted via http://www.ruby-forum.com/. -- 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