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
0e8e78ac
Commit
0e8e78ac
authored
Jan 06, 2020
by
Arturo Herrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove count_by from UsageData#count
This change was introduced in
dd85269a
but it hasn't been used.
parent
b5d8f44b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
8 deletions
+2
-8
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-2
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+0
-6
No files found.
lib/gitlab/usage_data.rb
View file @
0e8e78ac
...
...
@@ -228,8 +228,8 @@ module Gitlab
{}
# augmented in EE
end
def
count
(
relation
,
count_by:
nil
,
fallback:
-
1
)
count_by
?
relation
.
count
(
count_by
)
:
relation
.
count
def
count
(
relation
,
fallback:
-
1
)
relation
.
count
rescue
ActiveRecord
::
StatementInvalid
fallback
end
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
0e8e78ac
...
...
@@ -339,12 +339,6 @@ describe Gitlab::UsageData do
expect
(
described_class
.
count
(
relation
)).
to
eq
(
1
)
end
it
'returns the count for count_by when provided'
do
allow
(
relation
).
to
receive
(
:count
).
with
(
:creator_id
).
and_return
(
2
)
expect
(
described_class
.
count
(
relation
,
count_by: :creator_id
)).
to
eq
(
2
)
end
it
'returns the fallback value when counting fails'
do
allow
(
relation
).
to
receive
(
:count
).
and_raise
(
ActiveRecord
::
StatementInvalid
.
new
(
''
))
...
...
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