summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-07-10 11:30:16 +0200
committerRémy Coutable <remy@rymai.me>2018-07-11 11:52:02 +0200
commit1915c9f0cf1ec3e836c02ba57c97e5a9a61d487b (patch)
treea0e01458fd7b2c9ff71dc4c8883e984e8231736a
parent867018aab4fe2a305ebc58193da5c19e72827ddf (diff)
downloadgitlab-ce-1915c9f0cf1ec3e836c02ba57c97e5a9a61d487b.tar.gz
Moving 400 lines of code
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--app/models/project.rb301
-rw-r--r--app/models/user.rb27
2 files changed, 315 insertions, 13 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 770262f6193..2cc0c83d064 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -2182,5 +2182,306 @@ class Project < ActiveRecord::Base
else
check_access.call
end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 1c5d39db118..4aeaaedfe4d 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -441,6 +441,20 @@ class User < ActiveRecord::Base
[:ghost]
end
+ def full_website_url
+ return "http://#{website_url}" if website_url !~ %r{\Ahttps?://}
+
+ website_url
+ end
+
+ def short_website_url
+ website_url.sub(%r{\Ahttps?://}, '')
+ end
+
+ def all_ssh_keys
+ keys.map(&:publishable_key)
+ end
+
def internal?
self.class.internal_attributes.any? { |a| self[a] }
end
@@ -845,19 +859,6 @@ class User < ActiveRecord::Base
project.project_member(self)
end
- def full_website_url
- return "http://#{website_url}" if website_url !~ %r{\Ahttps?://}
-
- website_url
- end
-
- def short_website_url
- website_url.sub(%r{\Ahttps?://}, '')
- end
-
- def all_ssh_keys
- keys.map(&:publishable_key)
- end
def temp_oauth_email?
email.start_with?('temp-email-for-oauth')