From e1c57c684340681aafb055408d682c0fc65e24e5 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Tue, 3 Sep 2013 16:17:45 +0800 Subject: [PATCH] fixed default widget for tags --- app/controllers/default_widget_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/default_widget_controller.rb b/app/controllers/default_widget_controller.rb index fa7d12636..fc80c3347 100644 --- a/app/controllers/default_widget_controller.rb +++ b/app/controllers/default_widget_controller.rb @@ -18,11 +18,11 @@ class DefaultWidgetController< OrbitWidgetController if !params["tag_id"].blank? if params["category_id"].blank? #has tag no cate result = eval(@ori_query) - result.selector[:tagged_ids] = { "$in" => params['tag_id'].collect{|t| BSON::ObjectId(t)}} + result.selector[:tagged_ids] = { "$in" => params['tag_id'] } else #has tag and cate result = eval(@ori_query) result.selector[get_category_field_name] = { "$in" => params['category_id'].collect{|t| BSON::ObjectId(t)}} - result.selector[:tagged_ids] = { "$in" => params['tag_id'].collect{|t| BSON::ObjectId(t)}} + result.selector[:tagged_ids] = { "$in" => params['tag_id'] } end elsif params["category_id"].blank? #no tag no cate result = eval(@ori_query)