Hi,
Searching with SQL is a good solution to make complex queries. Take into
account that with Rails 3 you can make a lot of queries without too much
SQL. For example:
Client.joins(:invoices => :invoice_lines).
group("
clients.id").
having("sum(invoice_lines.price) > ?", 3000).
where("strftime('%Y', invoices.invoice_date) = ?", "2012")
}
Apart from this style thing, it is hard for me to imagine a case where
you need to mix two models in the same list. Maybe you could rethink
your view in a simpler way?
If you want to filter with fields from a related table, you can try the
Ransack gem. There's a Hobo gem that might help too:
https://github.com/suyccom/hobo-metasearch
Regards,
Ignacio
El 15/01/13 21:38,
herrw...@gmail.com escribi�:
> --
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/hobousers/-/JF5A8iFx4fEJ.
> To post to this group, send email to
hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
>
hobousers+...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/hobousers?hl=en.
--
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre