We can turn lines 6-11 int this:
cart_item_traits.map(&:name).include?('green')