spree/spree — pull request #2409 by jphpsf (2013-01-09 05:14:10+00:00)
Title: Fix duplicate result if name contains SKU

My Spree app happens to have product names that includes part of the SKUs. When I create an order in the admin, the products autocomplete then return duplicated results (because both the SKU and the name matches)

**Step to reproduce:** in the Spree admin, create a product named *"ABC test"* with a SKU *"ABC123"*. Go to the *Orders* tab and create a *New Order*. Search for *"ABC"* in the product field. When the autocomplete results appears you should see a duplicate entry for *"ABC test"*.

**Expected behavior:** no duplicate entries :)

**Broken behavior:** duplicate entries!

**Fix:** the fix is trivial. In the product controller, I added a call to ````#uniq```` at the end of the ````#collection```` method. Also added a test to verify the behavior.

Cheers!