Hi everyone,
this is about http://dev.rubyonrails.org/ticket/7147
which has been close as wont fix. it seems like I cannot post comment on
this bug anymore...
neither my account (somekool) have the right to create new tickets.
anyhow. I was looking at using both :select and :include in a query but
could not as they are mutually exclusive. they I found this ticket close as
won't fix.
I understand the initial request is rather difficult to implement without
getting important performance drawbacks.
but I think this could be solved by adding a new attributes such as
:select_append
so a query would look like this
Store.find :all,
:select_*append* => 'sum(books.price * books.stock) as total_inventory',
:include => [:manager[:name], :address, {:books[:title, :stock, :price]
=> :author}],
:joins => 'join owners on stores.owner_id = owners.id',
:conditions => "addresses.city = 'Sydney'",
:group => 'stores.id'
ActiveRecord would still manage the whole thing as usual. without having to
write a full sql parser and the user would be allowed to specify more
columns in the select by just appending them. I beleive this would be a
great add-on to active record.
in the same trend, I'd like to be to use :include => with find_by_sql
sometimes, I need to write my own SQL joining multiple tables. but if AR
could do its magic with the :include that'd be rather awesome
thanks
On Mon, Nov 9, 2009 at 5:02 AM, Hongli Lai <[email protected]> wrote:
>
> On Nov 8, 10:38 pm, Ryan Bigg <[email protected]> wrote:
> > The site is down:http://downforeveryoneorjustme.com/rubyonrails.org
>
> Looks up to me.
> >
>
--
Go is to Western chess what philosophy is to double entry accounting.
- From Shibumi, bestseller by Trevanian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---