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
04b64288
Commit
04b64288
authored
Feb 12, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable query limiting warnings for now on GitLab.com
parent
498ade48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
lib/gitlab/query_limiting.rb
lib/gitlab/query_limiting.rb
+1
-1
spec/lib/gitlab/query_limiting_spec.rb
spec/lib/gitlab/query_limiting_spec.rb
+6
-4
No files found.
lib/gitlab/query_limiting.rb
View file @
04b64288
...
@@ -6,7 +6,7 @@ module Gitlab
...
@@ -6,7 +6,7 @@ module Gitlab
# This ensures we don't produce any errors that users can't do anything
# This ensures we don't produce any errors that users can't do anything
# about themselves.
# about themselves.
def
self
.
enable?
def
self
.
enable?
Gitlab
.
com?
||
Rails
.
env
.
development?
||
Rails
.
env
.
test?
Rails
.
env
.
development?
||
Rails
.
env
.
test?
end
end
# Allows the current request to execute any number of SQL queries.
# Allows the current request to execute any number of SQL queries.
...
...
spec/lib/gitlab/query_limiting_spec.rb
View file @
04b64288
...
@@ -12,14 +12,16 @@ describe Gitlab::QueryLimiting do
...
@@ -12,14 +12,16 @@ describe Gitlab::QueryLimiting do
expect
(
described_class
.
enable?
).
to
eq
(
true
)
expect
(
described_class
.
enable?
).
to
eq
(
true
)
end
end
it
'returns true on GitLab.com'
do
it
'returns false on GitLab.com'
do
expect
(
Rails
.
env
).
to
receive
(
:development?
).
and_return
(
false
)
expect
(
Rails
.
env
).
to
receive
(
:test?
).
and_return
(
false
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
expect
(
described_class
.
enable?
).
to
eq
(
tru
e
)
expect
(
described_class
.
enable?
).
to
eq
(
fals
e
)
end
end
it
'returns
tru
e in a non GitLab.com'
do
it
'returns
fals
e in a non GitLab.com'
do
expect
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
false
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
false
)
expect
(
Rails
.
env
).
to
receive
(
:development?
).
and_return
(
false
)
expect
(
Rails
.
env
).
to
receive
(
:development?
).
and_return
(
false
)
expect
(
Rails
.
env
).
to
receive
(
:test?
).
and_return
(
false
)
expect
(
Rails
.
env
).
to
receive
(
:test?
).
and_return
(
false
)
...
...
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