]> source.dussan.org Git - redmine.git/commitdiff
Disable grouping for associations custom field (#35115).
authorGo MAEDA <maeda@farend.jp>
Wed, 21 Apr 2021 07:29:02 +0000 (07:29 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 21 Apr 2021 07:29:02 +0000 (07:29 +0000)
Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@20956 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index 231ded24b78c2152aca5bf9b350546c63db90a38..e8de4aa6d3f47a16b480e0d37c7fd3c8b095c620 100644 (file)
@@ -179,7 +179,7 @@ class QueryAssociationCustomFieldColumn < QueryCustomFieldColumn
   def initialize(association, custom_field, options={})
     super(custom_field, options)
     self.name = "#{association}.cf_#{custom_field.id}".to_sym
-    # TODO: support sorting/grouping by association custom field
+    # TODO: support sorting by association custom field
     self.sortable = false
     self.groupable = false
     @association = association
@@ -194,6 +194,11 @@ class QueryAssociationCustomFieldColumn < QueryCustomFieldColumn
   def css_classes
     @css_classes ||= "#{@association}_cf_#{@cf.id} #{@cf.field_format}"
   end
+
+  # TODO: support grouping by association custom field
+  def groupable?
+    false
+  end
 end
 
 class QueryFilter