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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4b737a20
Commit
4b737a20
authored
Mar 11, 2020
by
allison.browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change queries from using count to limit
parent
ea5991bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app/controllers/admin/serverless/domains_controller.rb
app/controllers/admin/serverless/domains_controller.rb
+2
-2
lib/api/users.rb
lib/api/users.rb
+2
-2
lib/gitlab/legacy_github_import/importer.rb
lib/gitlab/legacy_github_import/importer.rb
+1
-1
No files found.
app/controllers/admin/serverless/domains_controller.rb
View file @
4b737a20
...
...
@@ -9,7 +9,7 @@ class Admin::Serverless::DomainsController < Admin::ApplicationController
end
def
create
if
PagesDomain
.
instance_serverless
.
count
>
0
if
PagesDomain
.
instance_serverless
.
exists?
return
redirect_to
admin_serverless_domains_path
,
notice:
_
(
'An instance-level serverless domain already exists.'
)
end
...
...
@@ -31,7 +31,7 @@ class Admin::Serverless::DomainsController < Admin::ApplicationController
end
def
destroy
if
domain
.
serverless_domain_clusters
.
count
>
0
if
domain
.
serverless_domain_clusters
.
exists?
return
redirect_to
admin_serverless_domains_path
,
status: :conflict
,
notice:
_
(
'Domain cannot be deleted while associated to one or more clusters.'
)
...
...
lib/api/users.rb
View file @
4b737a20
...
...
@@ -206,11 +206,11 @@ module API
conflict!
(
'Email has already been taken'
)
if
params
[
:email
]
&&
User
.
by_any_email
(
params
[
:email
].
downcase
)
.
where
.
not
(
id:
user
.
id
).
count
>
0
.
where
.
not
(
id:
user
.
id
).
exists?
conflict!
(
'Username has already been taken'
)
if
params
[
:username
]
&&
User
.
by_username
(
params
[
:username
])
.
where
.
not
(
id:
user
.
id
).
count
>
0
.
where
.
not
(
id:
user
.
id
).
exists?
user_params
=
declared_params
(
include_missing:
false
)
...
...
lib/gitlab/legacy_github_import/importer.rb
View file @
4b737a20
...
...
@@ -188,7 +188,7 @@ module Gitlab
end
def
apply_labels
(
issuable
,
raw
)
return
unless
raw
.
labels
.
count
>
0
return
unless
raw
.
labels
.
exists?
label_ids
=
raw
.
labels
.
map
{
|
attrs
|
@labels
[
attrs
.
name
]
}
...
...
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