The Spree (2.3.4) application I've inherited has a taxonomy named "Makers" with multiple taxons associated to it by 'taxonomy_id'. I have been tasked with sorting products by the taxon's 'name' property, something like
Spree::Product.order('taxon.name DESC')
I think I need to do an includes
on the Products table, but I'm not sure how to write that correctly.
How do I include the correct taxonomy in order to sort by a property of its taxons? Thanks.
Figured it out:
I didn't know that you could use
.where()
like that.