I have 3 tables, that provide a restful mechanism for creating history
for products. There is a list of (almost static) states that are linked
to a product via a progressions table.
Im interested in getting the release list for a given state, eg
When i progress a product to processed, that product will still appear
in the ordered list. At the moment i am doing the following, its rather
@processed_products = State.find_by_name('processed').products @ordered_products = State.find_by_name('ordered').products - @processed_products
This works fine, but now i need to get a count for the tabs (like in
google), and running all those selects seems over kill and SLOW. Ive
been looking at creating a query on the progression object using a
combination of order and distinct, or perhaps an association extension.
But just cant work it out…