Skip to content

Commit

Permalink
Merge pull request spree-contrib#177 from InnovativeOperations/perfor…
Browse files Browse the repository at this point in the history
…mance/use-exists-on-parts

Use exists? on parts
  • Loading branch information
damianlegawiec authored Apr 26, 2018
2 parents e7b875e + 17596ba commit dedf8b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/spree/product_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def variants_or_master
end

def assembly?
parts.present?
parts.exists?
end

def count_of(variant)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def items
price: li.price.to_f
}

if li.parts.present?
if li.parts.exists?
bundled_items = []
li.parts.each do |part|
bundled_items << {
Expand Down

0 comments on commit dedf8b2

Please sign in to comment.