From 2df0133cffdd4f0ae80f4826af9242cbef6aaaac Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 4 Feb 2014 16:28:52 -0600 Subject: [PATCH] Oops, using item proxies broke closet comparison. Fix. Turns out we need to assign closeted to actual items, not the item proxies, since that's what we check against. (I would've thought they're backed by the same instance of the item anyway, but, whatever. The fix works :P) --- app/controllers/closet_hangers_controller.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/closet_hangers_controller.rb b/app/controllers/closet_hangers_controller.rb index 4f3d0a2a2..c5aef5100 100644 --- a/app/controllers/closet_hangers_controller.rb +++ b/app/controllers/closet_hangers_controller.rb @@ -26,13 +26,15 @@ class ClosetHangersController < ApplicationController visible_groups = @user.closet_hangers_groups_visible_to(@perspective_user) @unlisted_closet_hangers_by_owned = find_unlisted_closet_hangers_by_owned(visible_groups) - items = Item::ProxyArray.new + item_proxies = Item::ProxyArray.new + items = [] @closet_lists_by_owned.each do |owned, lists| lists.each do |list| list.hangers.each do |hanger| hanger.item_proxy = Item::Proxy.new(hanger.item) - items << hanger.item_proxy + item_proxies << hanger.item_proxy + items << hanger.item end end end @@ -40,11 +42,12 @@ class ClosetHangersController < ApplicationController @unlisted_closet_hangers_by_owned.each do |owned, hangers| hangers.each do |hanger| hanger.item_proxy = Item::Proxy.new(hanger.item) - items << hanger.item_proxy + item_proxies << hanger.item_proxy + items << hanger.item end end - items.prepare_partial(:item_link_partial) + item_proxies.prepare_partial(:item_link_partial) if @public_perspective && user_signed_in? current_user.assign_closeted_to_items!(items)