solidus

https://github.com/solidusio/solidus

Ruby

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.

Spree::Core::ProductFilters.taxons_below

Provide filtering on the immediate children of a taxon

This doesn't fit the pattern of the examples above, so there's a few changes.
Firstly, it uses an existing scope which was not built for filtering - and so
has no need of a conditions mapping, and secondly, it has a mapping of name
to the argument type expected by the other scope.

This technique is useful for filtering on objects (by passing ids) or with a
scope that can be used directly (eg. testing only ever on a single property).

This scope selects products in any of the active taxons or their children.

Source | Google | Stack overflow

Edit

git clone [email protected]:solidusio/solidus.git

cd solidus

open core/lib/spree/core/product_filters.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Spree--Core--ProductFilters-taxons_below-for-pr


# Commit to git

git add core/lib/spree/core/product_filters.rbgit commit -m "better docs for Spree::Core::ProductFilters.taxons_below"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Spree--Core--ProductFilters-taxons_below-for-pr

hub pull-request


# Celebrate!