Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
cfca86b000f0
Commit
97a92f8a
authored
Nov 25, 2012
by
Dmitriy Zaporozhets
Browse files
Fixed user.namespace_id exception if namespace is nil
parent
8923c23c6eea
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/controllers/admin/projects_controller.rb
View file @
cfca86b0
...
...
@@ -47,9 +47,8 @@ def destroy
def
project
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
end
end
app/models/user.rb
View file @
cfca86b0
...
...
@@ -72,7 +72,6 @@ class User < ActiveRecord::Base
alias_attribute
:private_token
,
:authentication_token
delegate
:path
,
to: :namespace
,
allow_nil:
true
,
prefix:
true
delegate
:id
,
to: :namespace
,
allow_nil:
true
,
prefix:
true
# Scopes
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