From 4fbb66d19d405ef54a8faabd513a6be1e3fd3a56 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 7 Apr 2020 10:24:41 +0800 Subject: [PATCH] fix not found error --- app/controllers/announcements_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index f28c72c..9df117a 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -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