[eluser]davidMC1982[/eluser]
When using include_related or similar on a has_many relationship, how can you limit the included result to just one.
Specifically:
Products - id, name, manufacturer_id
Items - id, product_id, ratetype_id, price
Ratetypes - id, name, is_sell
Manufacturer - id, name
Products have many Items and one Manufacturer
Items have one Product and one Ratetype
I want to list the products from a specific manufacturer, including the price from the item table, where the price is the lowest for that product.
I'd be happy with a plain old sql query but it must return a Product object as I am using the same view in many places throughout my site.
Thanks for any ideas.