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
Jérome Perrin
gitlab-ce
Commits
97a92f8a
Commit
97a92f8a
authored
Nov 25, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed user.namespace_id exception if namespace is nil
parent
c31d48dd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
app/controllers/admin/projects_controller.rb
app/controllers/admin/projects_controller.rb
+1
-2
app/models/user.rb
app/models/user.rb
+0
-1
No files found.
app/controllers/admin/projects_controller.rb
View file @
97a92f8a
...
@@ -47,9 +47,8 @@ class Admin::ProjectsController < AdminController
...
@@ -47,9 +47,8 @@ class Admin::ProjectsController < AdminController
def
project
def
project
id
=
params
[
:project_id
]
||
params
[
:id
]
id
=
params
[
:project_id
]
||
params
[
:id
]
id
=
id
.
split
(
"/"
)
if
id
.
include?
(
"/"
)
@project
||=
Project
.
find_by_path
(
id
)
@project
=
Project
.
find_with_namespace
(
id
)
@project
||
render_404
@project
||
render_404
end
end
end
end
app/models/user.rb
View file @
97a92f8a
...
@@ -72,7 +72,6 @@ class User < ActiveRecord::Base
...
@@ -72,7 +72,6 @@ class User < ActiveRecord::Base
alias_attribute
:private_token
,
:authentication_token
alias_attribute
:private_token
,
:authentication_token
delegate
:path
,
to: :namespace
,
allow_nil:
true
,
prefix:
true
delegate
:path
,
to: :namespace
,
allow_nil:
true
,
prefix:
true
delegate
:id
,
to: :namespace
,
allow_nil:
true
,
prefix:
true
# Scopes
# Scopes
scope
:not_in_project
,
->
(
project
)
{
where
(
"id not in (:ids)"
,
ids:
project
.
users
.
map
(
&
:id
)
)
}
scope
:not_in_project
,
->
(
project
)
{
where
(
"id not in (:ids)"
,
ids:
project
.
users
.
map
(
&
:id
)
)
}
...
...
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