Read about our upcoming Code of Conduct on this issue

Commit b8066e2c authored by Douwe Maan's avatar Douwe Maan
Browse files

No more web url

parent 302555e87f65
......@@ -17,7 +17,6 @@
require 'file_size_validator'
class Group < Namespace
include Rails.application.routes.url_helpers
include Referable
has_many :group_members, dependent: :destroy, as: :source, class_name: 'GroupMember'
......@@ -63,10 +62,6 @@ def avatar_url(size = nil)
end
end
def web_url
group_url(self)
end
def owners
@owners ||= group_members.owners.map(&:user)
end
......
......@@ -36,7 +36,6 @@ class Project < ActiveRecord::Base
include Gitlab::ConfigHelper
include Gitlab::ShellAdapter
include Gitlab::VisibilityLevel
include Rails.application.routes.url_helpers
include Referable
include Sortable
......@@ -316,7 +315,7 @@ def to_reference(_from_project = nil)
end
def web_url
namespace_project_url(self.namespace, self)
Rails.application.routes.url_helpers.namespace_project_url(self.namespace, self)
end
def web_url_without_protocol
......
......@@ -67,7 +67,6 @@ class User < ActiveRecord::Base
include Gitlab::ConfigHelper
include Gitlab::CurrentSettings
include Rails.application.routes.url_helpers
include Referable
include Sortable
include TokenAuthenticatable
......@@ -638,10 +637,6 @@ def avatar_url(size = nil)
end
end
def web_url
user_url(self)
end
def all_emails
[self.email, *self.emails.map(&:email)]
end
......
......@@ -5,7 +5,11 @@ class UserSafe < Grape::Entity
end
class UserBasic < UserSafe
expose :id, :state, :avatar_url, :web_url
expose :id, :state, :avatar_url
expose :web_url do |user, options|
Rails.application.routes.url_helpers.user_url(user)
end
end
class User < UserBasic
......@@ -70,7 +74,11 @@ class ProjectMember < UserBasic
class Group < Grape::Entity
expose :id, :name, :path, :description
expose :avatar_url, :web_url
expose :avatar_url
expose :web_url do |group, options|
Rails.application.routes.url_helpers.group_url(group)
end
end
class GroupDetail < Group
......
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