Commit b8066e2c authored by Douwe Maan's avatar Douwe Maan

No more web url

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