fix error
This commit is contained in:
parent
3baa783c44
commit
9211ab2cf7
|
@ -7,7 +7,7 @@ class AnnouncementFeedsController < ApplicationController
|
||||||
enddt = params[:end].blank? ? nil : params[:end]
|
enddt = params[:end].blank? ? nil : params[:end]
|
||||||
dt = params[:date].blank? ? nil : params[:date]
|
dt = params[:date].blank? ? nil : params[:date]
|
||||||
feed_cache = BulletinFeedCache.where(uid: uid, start: startdt, end: enddt, date: dt)
|
feed_cache = BulletinFeedCache.where(uid: uid, start: startdt, end: enddt, date: dt)
|
||||||
feed_cache.where(:invalid_date.lte => Time.now).destroy
|
feed_cache.all_of({:invalid_date.ne=>nil,:invalid_date.lte => Time.now}).destroy
|
||||||
count = feed_cache.count
|
count = feed_cache.count
|
||||||
if count > 1
|
if count > 1
|
||||||
feed_cache.limit(count-1).destroy
|
feed_cache.limit(count-1).destroy
|
||||||
|
|
|
@ -465,7 +465,7 @@ class AnnouncementsController < ApplicationController
|
||||||
widget_data_count = OrbitHelper.widget_data_count
|
widget_data_count = OrbitHelper.widget_data_count
|
||||||
anns_cache = AnnsCache.where(parent_id: subpart.id.to_s + cats.to_s + tags.to_s + widget_data_count.to_s,locale: I18n.locale.to_s)
|
anns_cache = AnnsCache.where(parent_id: subpart.id.to_s + cats.to_s + tags.to_s + widget_data_count.to_s,locale: I18n.locale.to_s)
|
||||||
devide_flag = (!(defined? SiteFeed).nil?)
|
devide_flag = (!(defined? SiteFeed).nil?)
|
||||||
anns_cache.where(:invalid_date.ne=>nil).where(:invalid_date.lte => Time.now).destroy
|
anns_cache.all_of({:invalid_date.ne=>nil,:invalid_date.lte => Time.now}).destroy
|
||||||
count = anns_cache.count
|
count = anns_cache.count
|
||||||
if count > 1
|
if count > 1
|
||||||
anns_cache.limit(count-1).destroy
|
anns_cache.limit(count-1).destroy
|
||||||
|
|
Loading…
Reference in New Issue