openfoodnetwork
https://github.com/openfoodfoundation/openfoodnetwork
Ruby
Connect suppliers, distributors and consumers to trade local produce.
OrderCycle#valid_products_distributed_by
If a product without variants is added to an order cycle, and then some variants are added to that product, but not the order cycle, then the master variant should not available for customers to purchase. This method filters out such products so that the customer cannot purchase them.
Edit
git clone [email protected]:openfoodfoundation/openfoodnetwork.git
cd openfoodnetwork
open app/models/order_cycle.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-OrderCycle-valid_products_distributed_by-for-pr
# Commit to gitgit add app/models/order_cycle.rbgit commit -m "better docs for OrderCycle#valid_products_distributed_by"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-OrderCycle-valid_products_distributed_by-for-pr
hub pull-request
# Celebrate!