spree-contrib / spree_related_products

Related products extension for Spree Commerce.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
149 stars 241 forks source link

has_related_products? doesnt work like you should expect #88

Open reinaris opened 10 years ago

reinaris commented 10 years ago

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