spree-contrib / spree_related_products

Related products extension for Spree Commerce.

Home Page:http://guides.spreecommerce.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

has_related_products? doesnt work like you should expect

reinaris opened this issue · comments

commented

The has_related_products? method on a product (explained in the Readme) doesn't work like the example tells you.

product.has_related_products?("accessories") just checks if the relation type "accessories" is defined in general. Not if the product got relations with relation type "accessories".

See:
https://github.com/spree/spree_related_products/blob/2-2-stable/app/models/spree/product_decorator.rb#L64