Skip to content
Snippets Groups Projects
Unverified Commit 1b232213 authored by Mayra Cabrera's avatar Mayra Cabrera Committed by Marin Jankovski
Browse files

Merge branch 'ac-63020-typeerror-nil-can-t-be-coerced-into-integer' into 'master'

Fix nil coercion updating storage size on project statistics

See merge request gitlab-org/gitlab-ce!29425
parent d4db27f6
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -52,7 +52,7 @@ class ProjectStatistics < ApplicationRecord
end
 
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
 
# Since this incremental update method does not call update_storage_size above,
Loading
Loading
---
title: Fix nil coercion updating storage size on project statistics
merge_request: 29425
author:
type: fixed
Loading
Loading
@@ -183,6 +183,18 @@ describe ProjectStatistics do
 
expect(statistics.storage_size).to eq 9
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
 
describe '.increment_statistic' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment