Skip to content

Commit

Permalink
Merge pull request spree-contrib#178 from InnovativeOperations/deprec…
Browse files Browse the repository at this point in the history
…ations/distinct

Update uniq to distinct
  • Loading branch information
damianlegawiec authored Apr 26, 2018
2 parents 87bea28 + f4e7d7b commit e7b875e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/spree/admin/parts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def available
@available_products = []
else
query = "%#{params[:q]}%"
@available_products = Spree::Product.search_can_be_part(query).uniq
@available_products = Spree::Product.search_can_be_part(query).distinct!
end
respond_to do |format|
format.html {render :layout => false}
Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/line_item_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Spree
LineItem.class_eval do
scope :assemblies, -> { joins(product: :parts).uniq }
scope :assemblies, -> { joins(product: :parts).distinct }

has_many :part_line_items, dependent: :destroy

Expand Down

0 comments on commit e7b875e

Please sign in to comment.