app/controllers/hubstats/repos_controller.rb in hubstats-0.3.11 vs app/controllers/hubstats/repos_controller.rb in hubstats-0.3.12

- old
+ new

@@ -23,13 +23,13 @@ @pull_count = Hubstats::PullRequest.belonging_to_repo(@repo.id).merged_since(@timespan).count(:all) @deploys = Hubstats::Deploy.belonging_to_repo(@repo.id).deployed_since(@timespan).order("deployed_at DESC").limit(20) @deploy_count = Hubstats::Deploy.belonging_to_repo(@repo.id).deployed_since(@timespan).count(:all) @comment_count = Hubstats::Comment.belonging_to_repo(@repo.id).created_since(@timespan).count(:all) @user_count = Hubstats::User.with_pulls_or_comments(@timespan,@repo.id).only_active.length - @net_additions = Hubstats::PullRequest.belonging_to_repo(@repo.id).merged_since(@timespan).sum(:additions).to_i - - Hubstats::PullRequest.belonging_to_repo(@repo.id).merged_since(@timespan).sum(:deletions).to_i - @additions = Hubstats::PullRequest.belonging_to_repo(@repo.id).merged_since(@timespan).average(:additions) - @deletions = Hubstats::PullRequest.belonging_to_repo(@repo.id).merged_since(@timespan).average(:deletions) + @net_additions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_repo(@repo.id).sum(:additions).to_i - + Hubstats::PullRequest.merged_since(@timespan).belonging_to_repo(@repo.id).sum(:deletions).to_i + @additions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_repo(@repo.id).average(:additions) + @deletions = Hubstats::PullRequest.merged_since(@timespan).belonging_to_repo(@repo.id).average(:deletions) stats end def dashboard