Commit b8066e2c authored by Douwe Maan's avatar Douwe Maan

No more web url

parent 72c552c2
......@@ -17,7 +17,6 @@ require 'carrierwave/orm/activerecord'
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 @@ class Group < Namespace
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 @@ class Project < ActiveRecord::Base
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 @@ class User < ActiveRecord::Base
end
end
def web_url
user_url(self)
end
def all_emails
[self.email, *self.emails.map(&:email)]
end
......
......@@ -5,7 +5,11 @@ module API
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 @@ module API
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