diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 957856cdd..b227a7f3d 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -121,6 +121,7 @@ class RepositoriesController < ApplicationController end def authorizate! + return if current_user && current_user.admin? if @project.repository.hidden? && !@project.member?(current_user) render_forbidden end @@ -141,7 +142,7 @@ class RepositoriesController < ApplicationController @ref = params[:ref] || "master" end - def get_latest_commit + def get_latest_commit latest_commit = project_commits @latest_commit = latest_commit[:body][0] if latest_commit.present? @commits_count = latest_commit[:total_count] if latest_commit.present? diff --git a/db/migrate/20200716055018_reset_project_issues_counte.rb b/db/migrate/20200716055018_reset_project_issues_counte.rb new file mode 100644 index 000000000..15af620c4 --- /dev/null +++ b/db/migrate/20200716055018_reset_project_issues_counte.rb @@ -0,0 +1,9 @@ +class ResetProjectIssuesCounte < ActiveRecord::Migration[5.2] + def change + projects = Project.select(:id, :issues_count).all + projects.each do |p| + puts p.id + Project.reset_counters( p.id, :issues_count, touch: false ) + end + end +end