summaryrefslogtreecommitdiffstats
path: root/app/helpers/queries_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-14 10:52:38 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-14 10:52:38 +0000
commitf1678e4f778c111ec97528eb57672e2d8d01e37c (patch)
tree51647ec750effa364e90f8879b93b8e50dead183 /app/helpers/queries_helper.rb
parentcb15f0df380031ec44c53c71755bd9926c17aa32 (diff)
downloadredmine-f1678e4f778c111ec97528eb57672e2d8d01e37c.tar.gz
redmine-f1678e4f778c111ec97528eb57672e2d8d01e37c.zip
Filters on chained custom fields and custom field attributes (#21249).
git-svn-id: http://svn.redmine.org/redmine/trunk@16191 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/queries_helper.rb')
-rw-r--r--app/helpers/queries_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 66793e493..570ccb368 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -28,6 +28,8 @@ module QueriesHelper
group = :label_relations
elsif field_options[:type] == :tree
group = query.is_a?(IssueQuery) ? :label_relations : nil
+ elsif field =~ /^cf_\d+\./
+ group = (field_options[:through] || field_options[:field]).try(:name)
elsif field =~ /^(.+)\./
# association filters
group = "field_#{$1}".to_sym
@@ -48,7 +50,7 @@ module QueriesHelper
end
s = options_for_select([[]] + ungrouped)
if grouped.present?
- localized_grouped = grouped.map {|k,v| [l(k), v]}
+ localized_grouped = grouped.map {|k,v| [k.is_a?(Symbol) ? l(k) : k.to_s, v]}
s << grouped_options_for_select(localized_grouped)
end
s