Moving 400 lines of code

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2018-07-10 11:30:16 +02:00
parent 867018aab4
commit 1915c9f0cf
No known key found for this signature in database
GPG key ID: 98DFFD1C0C62B70B
2 changed files with 315 additions and 13 deletions

View file

@ -2182,5 +2182,306 @@ class Project < ActiveRecord::Base
else
check_access.call
end
end
end

View file

@ -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')