I have products that can be a part of an assembly. I only had one assembly, which I called a bundle.
Originally, given that a product had any parts, I included an additional option
If I use
<% if @product.parts.any?(&:in_stock?) %>
HERE I SHOW OPTION FORM
<% end %>
This works, and displays my option. However now I have another option I'd like to show.
I need to show options to corresponding IDs. It seems that my original product part has an ID of 'bundle', so I tried:
<% if @product.parts.find_by_id('bundle') %>
However my option doesn't load. Any ideas what I could be doing wrong? I don't get an error, it's just not finding that id.
Rails 4 & Spree 2.1+