Commit 8f9e2965 authored by James Lopez's avatar James Lopez

refactor project_or_wiki

parent 04bb520e
...@@ -6,6 +6,12 @@ module EE ...@@ -6,6 +6,12 @@ module EE
GEO_SERVER_DOCS_URL = 'https://docs.gitlab.com/ee/gitlab-geo/using_a_geo_server.html'.freeze GEO_SERVER_DOCS_URL = 'https://docs.gitlab.com/ee/gitlab-geo/using_a_geo_server.html'.freeze
protected
def project_or_wiki
@project
end
private private
def push_to_read_only_message def push_to_read_only_message
...@@ -30,10 +36,6 @@ module EE ...@@ -30,10 +36,6 @@ module EE
def current_user def current_user
user user
end end
def project_or_wiki
self.class.name == 'Gitlab::GitAccessWiki' ? @project.wiki : @project
end
end end
end end
end end
module EE
module Gitlab
module GitAccessWiki
prepend GeoGitAccess
private
def project_or_wiki
@project.wiki
end
end
end
end
module Gitlab module Gitlab
class GitAccessWiki < GitAccess class GitAccessWiki < GitAccess
prepend EE::Gitlab::GeoGitAccess prepend EE::Gitlab::GitAccessWiki
ERROR_MESSAGES = { ERROR_MESSAGES = {
read_only: "You can't push code to a read-only GitLab instance.", read_only: "You can't push code to a read-only GitLab instance.",
......
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