- browsing by subcategory
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user