diff --git a/app/models/bulletin_feed.rb b/app/models/bulletin_feed.rb index 1986c65..efeaa38 100644 --- a/app/models/bulletin_feed.rb +++ b/app/models/bulletin_feed.rb @@ -80,11 +80,13 @@ class BulletinFeed anns_before_filter = anns_before_filter.filter_by_tags(tags) end if !categories.empty? - anns_before_filter = anns_before_filter.filter_by_categories(categories) + anns_before_filter = anns_before_filter.filter_by_categories(categories,paginate=false) end anns_before_filter.selector = {"$and"=>[anns_before_filter.selector,{"$or"=>(I18n.available_locales.map{|v| {"title.#{v}"=>{"$nin"=>["", nil]}}})}]} if can_display_and_sorted_flag announcements = anns_before_filter.valid_time_range.to_a + else + announcements = anns_before_filter.to_a end else announcements = [] @@ -188,13 +190,6 @@ class BulletinFeed }.to_json BulletinFeedCache.where(uid: uid,start: startdt,end: enddt,date: dt).destroy feed_cache = BulletinFeedCache.create(uid: uid,content: anns,start: startdt,end: enddt,date: dt,invalid_date: invalid_date) - (1..5).each do - if JSON.load(feed_cache.content)['announcements'].length == all_anns.length - break - else - sleep(1) - end - end all_anns end def self.smart_convertor(text,url)