From 9654db689a86c71fc9f680e40f03a5668079c0d9 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 5 Jun 2020 23:50:09 +0800 Subject: [PATCH] Fix cannot display new gallery caused by the limit at filter_by_widget_categories. --- app/controllers/galleries_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 9d51c4f..0378011 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -77,7 +77,7 @@ class GalleriesController < ApplicationController end def widget tags = OrbitHelper.widget_tags.empty? ? ["all"] : OrbitHelper.widget_tags - album_ids = Album.filter_by_widget_categories.filter_by_tags(tags).pluck(:id) + album_ids = Album.filter_by_widget_categories(OrbitHelper.widget_categories,false).filter_by_tags(tags).pluck(:id) params = OrbitHelper.params counts = OrbitHelper.widget_data_count images = AlbumImage.where({album_id:{"$in"=>album_ids}}).desc(:id).limit(counts *5).sample(counts)