From 5ec9aa85a809ff4613f8df09526a7703eef0a7b6 Mon Sep 17 00:00:00 2001 From: rulingcom Date: Fri, 16 Oct 2026 14:10:23 +0800 Subject: [PATCH] Fix feed source filter for Mongoid 8: pluck on localized channel_title returns the current-locale string --- app/controllers/admin/feeds_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/feeds_controller.rb b/app/controllers/admin/feeds_controller.rb index b25405c..1887209 100644 --- a/app/controllers/admin/feeds_controller.rb +++ b/app/controllers/admin/feeds_controller.rb @@ -105,8 +105,8 @@ class Admin::FeedsController < OrbitAdminController def announcements @filter_fields = {} @filter_fields['feed.source'] = SiteFeed.all.pluck(:channel_title,:remote_site_url).collect do |a,b| - tp = (a.blank? || a[I18n.locale].blank?) ? b.gsub(/http:\/\/|https:\/\//,'').gsub(/\./,'-') : a[I18n.locale] - tp + tp = a.blank? ? b.gsub(/http:\/\/|https:\/\//,'').gsub(/\./,'-') : a + tp end.uniq.map{|tp| {:title => tp,:id => tp}} @filter_fields['feed.module_name'] = SiteFeed.all.map{|s| s.channel_key}.uniq.map do |key| {:title => I18n.t("module_name.#{key}"),:id => key}