mirror of
https://github.com/redmine/redmine.git
synced 2026-03-29 16:50:54 +02:00
Merged r20783 from trunk to 4.0-stable (#33548).
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@20785 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -48,7 +48,7 @@ class QueryColumn
|
||||
|
||||
# Returns true if the column is sortable, otherwise false
|
||||
def sortable?
|
||||
!@sortable.nil?
|
||||
@sortable.present?
|
||||
end
|
||||
|
||||
def sortable
|
||||
|
||||
@@ -1485,6 +1485,16 @@ class QueryTest < ActiveSupport::TestCase
|
||||
assert !q.sortable_columns['cf_1']
|
||||
end
|
||||
|
||||
def test_sortable_should_return_false_for_multi_custom_field
|
||||
field = CustomField.find(1)
|
||||
field.update_attribute :multiple, true
|
||||
|
||||
q = IssueQuery.new
|
||||
|
||||
field_column = q.available_columns.detect {|c| c.name==:cf_1}
|
||||
assert !field_column.sortable?
|
||||
end
|
||||
|
||||
def test_default_sort
|
||||
q = IssueQuery.new
|
||||
assert_equal [['id', 'desc']], q.sort_criteria
|
||||
|
||||
Reference in New Issue
Block a user