This instance will be upgraded to Heptapod 0.27.1 on 2021-12-02 at 15:00 UTC+1 (a few minutes of down time)

Unverified Commit 71103985 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Re-order some methods in Project

This ensures the order of these methods is identical in CE and EE.
parent 644b603bc7db
......@@ -63,16 +63,6 @@ def set_last_repository_updated_at
# update visibility_level of forks
after_update :update_forks_visibility_level
def update_forks_visibility_level
return unless visibility_level < visibility_level_was
forks.each do |forked_project|
if forked_project.visibility_level > visibility_level
forked_project.visibility_level = visibility_level
forked_project.save!
end
end
end
after_validation :check_pending_delete
......@@ -165,7 +155,7 @@ def update_forks_visibility_level
has_many :todos, dependent: :destroy
has_many :notification_settings, dependent: :destroy, as: :source
has_one :import_data, dependent: :delete, class_name: "ProjectImportData"
has_one :import_data, dependent: :delete, class_name: 'ProjectImportData'
has_one :project_feature, dependent: :destroy
has_one :statistics, class_name: 'ProjectStatistics', dependent: :delete
has_many :container_repositories, dependent: :destroy
......@@ -1060,6 +1050,17 @@ def repository_exists?
!!repository.exists?
end
def update_forks_visibility_level
return unless visibility_level < visibility_level_was
forks.each do |forked_project|
if forked_project.visibility_level > visibility_level
forked_project.visibility_level = visibility_level
forked_project.save!
end
end
end
def create_wiki
ProjectWiki.new(self, self.owner).wiki
true
......@@ -1068,6 +1069,10 @@ def create_wiki
false
end
def wiki
@wiki ||= ProjectWiki.new(self, self.owner)
end
def jira_tracker_active?
jira_tracker? && jira_service.active
end
......@@ -1190,10 +1195,6 @@ def remove_pages
end
end
def wiki
@wiki ||= ProjectWiki.new(self, self.owner)
end
def running_or_pending_build_count(force: false)
Rails.cache.fetch(['projects', id, 'running_or_pending_build_count'], force: force) do
builds.running_or_pending.count(:all)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment