fix not found error

This commit is contained in:
chiu 2020-04-07 10:24:41 +08:00
parent 9a6dbc4875
commit 4fbb66d19d
1 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ class AnnouncementsController < ApplicationController
tags = OrbitHelper.widget_tags || []
cats = OrbitHelper.widget_categories || []
subpart = OrbitHelper.get_current_widget
anns_cache = AnnsCache.where(parent_id: subpart.id,locale: I18n.locale.to_s)
anns_cache = AnnsCache.where(parent_id: subpart.id.to_s,locale: I18n.locale.to_s)
widget_data_count = OrbitHelper.widget_data_count
set_image_version_for_widget
if !(defined? SiteFeed).nil? || anns_cache.count != 1 || is_random
@ -129,7 +129,7 @@ class AnnouncementsController < ApplicationController
if anns_cache.count > 1
anns_cache.destroy
end
AnnsCache.create(parent_id: subpart.id,locale: I18n.locale.to_s,filter_result: sorted_anns.pluck(:id))
AnnsCache.create(parent_id: subpart.id.to_s,locale: I18n.locale.to_s,filter_result: sorted_anns.pluck(:id))
else
sorted_anns = sorted_anns.sample(widget_data_count)
end