Fix feed source filter for Mongoid 8: pluck on localized channel_title returns the current-locale string
This commit is contained in:
1 parent
45ea28b467
commit
5ec9aa85a8
1 file changed
+2
-2
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user