Fix cannot display new gallery caused by the limit at filter_by_widget_categories.
This commit is contained in:
parent
8edd91781e
commit
9654db689a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue