Yes yes, thats what I meant =)  Ruby 1.9.2 and Rails 2.3.9 it causes a
double query.  Under Ruby 1.9.1p243 and Rails 2.3.9 it correctly only
does the count query.

I found a bug for it in Lighthouse although no solutions.....
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5410-multiple-database-queries-when-chaining-named-scopes-with-rails-238-and-ruby-192#ticket-5410-2



On Oct 19, 5:21 pm, Marnen Laibow-Koser <[email protected]> wrote:
> Stephen wrote in post #955565:> Group
> >  has_many :topics, :as => :discussable  (via a module)
>
> > Topic
> >   belongs_to :discussable, :polymorphic => true
> >   named_scope :unhidden,       { :conditions => ['hidden = ?', false] }
>
> > Under rails 1.9.2
>
> [...]
>
> There is no such version.  Do you mean Ruby 1.9.2?  And with what
> version of Rails?
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> [email protected]
>
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to