- browsing by subcategory

This commit is contained in:
Edin Dazdarevic
2015-03-29 23:23:21 +02:00
parent 8e3557cf2e
commit 7c1eb2f4fd
12 changed files with 349 additions and 10 deletions

View File

@@ -20,4 +20,5 @@ class Item < ActiveRecord::Base
scope :all_in_category, -> (category_id) { where(on_display: true).joins( sub_category: [:category]).where(["category_id = ?", category_id]) }
scope :all_in_sub_category, -> (sub_category_id) { where(on_display: true).where(["sub_category_id = ?", sub_category_id]) }
end