On Feb 4, 11:06 pm, Gabriele Tassoni <[email protected]>
wrote:
>
> Trying to minimize the time spent on db query, by single query, I
> thought it could be great if I can concatenate the two results, indeed
> I can do:
>
> Customer.with_cellphones + Customer.with_emails
>
> but the resulting object is an Array, is there a way to obtain an
> ActiveRecord::NamedScope::Scope object?
>
Not that I can think of. even if it did work I expect you;d just end
up with a scope that it is equivalent to the first, slow, scope since
a scope is by definition not much more than a set of options to pass
to a single call to find (or count etc...)

Fred
> Thank you for the answer.
>
> G.
--~--~---------~--~----~------------~-------~--~----~
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