Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
b8066e2c
Commit
b8066e2c
authored
Jul 30, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No more web url
parent
72c552c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
14 deletions
+11
-14
app/models/group.rb
app/models/group.rb
+0
-5
app/models/project.rb
app/models/project.rb
+1
-2
app/models/user.rb
app/models/user.rb
+0
-5
lib/api/entities.rb
lib/api/entities.rb
+10
-2
No files found.
app/models/group.rb
View file @
b8066e2c
...
@@ -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
...
...
app/models/project.rb
View file @
b8066e2c
...
@@ -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
...
...
app/models/user.rb
View file @
b8066e2c
...
@@ -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
...
...
lib/api/entities.rb
View file @
b8066e2c
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment