How can I exclude some items in this scope:
scope :within_category, ->(category) { joins(:category).where(:categories => { :id => category }) }
like this:
scope :within_category, ->(category, item_type) { joins(:category).where(:categories => { :id => category }, :id NOT IN item_type.id) }
Try this: