Fixed: pagination do not show total visible issue count (#8633).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6314 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
521eaa79cb
commit
9cebf65568
|
@ -510,7 +510,7 @@ class Query < ActiveRecord::Base
|
|||
|
||||
# Returns the issue count
|
||||
def issue_count
|
||||
Issue.count(:include => [:status, :project], :conditions => statement)
|
||||
Issue.visible.count(:include => [:status, :project], :conditions => statement)
|
||||
rescue ::ActiveRecord::StatementInvalid => e
|
||||
raise StatementInvalid.new(e.message)
|
||||
end
|
||||
|
|
|
@ -471,7 +471,21 @@ class QueryTest < ActiveSupport::TestCase
|
|||
q.issues(:conditions => "foo = 1")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def test_issue_count
|
||||
q = Query.new(:name => '_')
|
||||
issue_count = q.issue_count
|
||||
assert_equal q.issues.size, issue_count
|
||||
end
|
||||
|
||||
def test_issue_count_with_archived_issues
|
||||
p = Project.generate!( :status => Project::STATUS_ARCHIVED )
|
||||
i = Issue.generate!( :project => p, :tracker => p.trackers.first )
|
||||
assert !i.visible?
|
||||
|
||||
test_issue_count
|
||||
end
|
||||
|
||||
def test_issue_count_by_association_group
|
||||
q = Query.new(:name => '_', :group_by => 'assigned_to')
|
||||
count_by_group = q.issue_count_by_group
|
||||
|
|
Loading…
Reference in New Issue