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
Léo-Paul Géneau
gitlab-ce
Commits
c699c6fe
Commit
c699c6fe
authored
Jun 10, 2019
by
Alessio Caiazza
Committed by
Mayra Cabrera
Jun 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix nil coercion updating storage size on project statistics
parent
de4e63b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
app/models/project_statistics.rb
app/models/project_statistics.rb
+1
-1
changelogs/unreleased/ac-63020-typeerror-nil-can-t-be-coerced-into-integer.yml
.../ac-63020-typeerror-nil-can-t-be-coerced-into-integer.yml
+5
-0
spec/models/project_statistics_spec.rb
spec/models/project_statistics_spec.rb
+12
-0
No files found.
app/models/project_statistics.rb
View file @
c699c6fe
...
@@ -54,7 +54,7 @@ class ProjectStatistics < ApplicationRecord
...
@@ -54,7 +54,7 @@ class ProjectStatistics < ApplicationRecord
end
end
def
update_storage_size
def
update_storage_size
self
.
storage_size
=
repository_size
+
wiki_size
+
lfs_objects_size
+
build_artifacts_size
+
packages_size
self
.
storage_size
=
repository_size
+
wiki_size
.
to_i
+
lfs_objects_size
+
build_artifacts_size
+
packages_size
end
end
# Since this incremental update method does not call update_storage_size above,
# Since this incremental update method does not call update_storage_size above,
...
...
changelogs/unreleased/ac-63020-typeerror-nil-can-t-be-coerced-into-integer.yml
0 → 100644
View file @
c699c6fe
---
title
:
Fix nil coercion updating storage size on project statistics
merge_request
:
29425
author
:
type
:
fixed
spec/models/project_statistics_spec.rb
View file @
c699c6fe
...
@@ -197,6 +197,18 @@ describe ProjectStatistics do
...
@@ -197,6 +197,18 @@ describe ProjectStatistics do
expect
(
statistics
.
storage_size
).
to
eq
9
expect
(
statistics
.
storage_size
).
to
eq
9
end
end
it
'works during wiki_size backfill'
do
statistics
.
update!
(
repository_size:
2
,
wiki_size:
nil
,
lfs_objects_size:
3
)
statistics
.
reload
expect
(
statistics
.
storage_size
).
to
eq
5
end
end
end
describe
'.increment_statistic'
do
describe
'.increment_statistic'
do
...
...
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