Fix feed source filter for Mongoid 8: pluck on localized channel_title returns the current-locale string

This commit is contained in:
rulingcom committed 2026-10-16 14:10:23 +08:00
1 parent 45ea28b467
commit 5ec9aa85a8
1 file changed
+2 -2
+2 -2
View File
@@ -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}