[Rails] An HMVC module to specialize controllers and views

2014-06-01 Thread BrĂ¡ulio Bhavamitra
Hello all, At EITA, we use Noosfero social-economic with multiple *plugins* (think of engines), each one with its models, controllers and views. These plugins may interact with other, even overwriting the behaviour of another plugin. That is where HMVC enters. The stating point for that in Contro

[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, sen

[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

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

2014-06-01 Thread Colin Law
On 1 June 2014 15:51, Rodrigo Lueneberg wrote: > I see that, but sometimes you want to reuse code in the same relation. > For instance if you do a query first using restricted columns and later > you need to do a count based on the result. Let's say in the first > relation with selected columns (c

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

2014-06-01 Thread josh.jor...@gmail.com
That was the point I was making in the issue I opened, yes. On Jun 1, 2014 10:53 AM, "Rodrigo Lueneberg" wrote: > I see that, but sometimes you want to reuse code in the same relation. > For instance if you do a query first using restricted columns and later > you need to do a count based on the

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

2014-06-01 Thread Rodrigo Lueneberg
I see that, but sometimes you want to reuse code in the same relation. For instance if you do a query first using restricted columns and later you need to do a count based on the result. Let's say in the first relation with selected columns (col1, col2, etc.) you want to use to fill an array. F

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 wrote: > Josh, > > If I remove the call to "select" how to specify which columns to sele

[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 Gro

[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, Ruby

[Rails] headless application

2014-06-01 Thread Maverick Gonzalez
Hi -- 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 an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to t