#899: update #init_statistics method, refactoring
This commit is contained in:
parent
0c6cc8afc8
commit
69d384412e
|
@ -10,7 +10,7 @@ class Projects::BaseController < ApplicationController
|
|||
end
|
||||
|
||||
def init_statistics
|
||||
@opened_issues_count = @project.has_issues ? @project.issues.without_pull_requests.opened.count : 0
|
||||
@opened_pull_requests_count = @project.issues.joins(:pull_request).opened.count
|
||||
@opened_issues_count = @project.issues.without_pull_requests.not_closed_or_merged.count
|
||||
@opened_pull_requests_count = @project.issues.joins(:pull_request).not_closed_or_merged.count
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ class Projects::IssuesController < Projects::BaseController
|
|||
# Using mb_chars for correct transform to lowercase ('Русский Текст'.downcase => "Русский Текст")
|
||||
@issues = @issues.search(params[:search_issue])
|
||||
|
||||
@opened_issues, @closed_issues = @issues.not_closed_or_merged.count, @issues.closed_or_merged.count
|
||||
@opened_issues, @closed_issues = @opened_issues_count, @issues.closed_or_merged.count
|
||||
if params[:status] == 'closed'
|
||||
@issues, @status = @issues.closed_or_merged, params[:status]
|
||||
else
|
||||
|
|
|
@ -92,7 +92,7 @@ class Projects::PullRequestsController < Projects::BaseController
|
|||
@issues_with_pull_request = @project.issues.joins(:pull_request)
|
||||
@issues_with_pull_request = @issues_with_pull_request.search(params[:search_pull_request])
|
||||
|
||||
@opened_issues, @closed_issues = @issues_with_pull_request.not_closed_or_merged.count, @issues_with_pull_request.closed_or_merged.count
|
||||
@opened_issues, @closed_issues = @opened_pull_requests_count, @issues_with_pull_request.closed_or_merged.count
|
||||
if params[:status] == 'closed'
|
||||
@issues_with_pull_request, @status = @issues_with_pull_request.closed_or_merged, params[:status]
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue