Created
January 13, 2009 14:56
-
-
Save hosiawak/46474 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has_and_belongs_to_many :brand_product_ranges, :class_name => 'ProductRange', :finder_sql => 'SELECT product_ranges.* FROM product_ranges INNER JOIN categories_product_ranges ON product_ranges.id = categories_product_ranges.product_range_id INNER JOIN products ON product_ranges.id = products.product_range_id AND products.show_on_brand_site = "1" WHERE (categories_product_ranges.category_id = #{self.id} ) GROUP BY product_ranges.id ORDER BY position' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment