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
Tatuya Kamada
gitlab-ce
Commits
4bb3675b
Commit
4bb3675b
authored
Jan 17, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Project#update_repository_size to convert MB to Bytes properly
parent
65046d9a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
app/models/project_statistics.rb
app/models/project_statistics.rb
+2
-1
changelogs/unreleased/26773-fix-project-statistics-repository-size.yml
...released/26773-fix-project-statistics-repository-size.yml
+4
-0
spec/models/project_statistics_spec.rb
spec/models/project_statistics_spec.rb
+1
-1
No files found.
app/models/project_statistics.rb
View file @
4bb3675b
...
@@ -25,8 +25,9 @@ class ProjectStatistics < ActiveRecord::Base
...
@@ -25,8 +25,9 @@ class ProjectStatistics < ActiveRecord::Base
self
.
commit_count
=
project
.
repository
.
commit_count
self
.
commit_count
=
project
.
repository
.
commit_count
end
end
# Repository#size needs to be converted from MB to Byte.
def
update_repository_size
def
update_repository_size
self
.
repository_size
=
project
.
repository
.
size
self
.
repository_size
=
project
.
repository
.
size
*
1
.
megabyte
end
end
def
update_lfs_objects_size
def
update_lfs_objects_size
...
...
changelogs/unreleased/26773-fix-project-statistics-repository-size.yml
0 → 100644
View file @
4bb3675b
---
title
:
Adjust ProjectStatistic#repository_size with values saved as MB
merge_request
:
8616
author
:
spec/models/project_statistics_spec.rb
View file @
4bb3675b
...
@@ -107,7 +107,7 @@ describe ProjectStatistics, models: true do
...
@@ -107,7 +107,7 @@ describe ProjectStatistics, models: true do
describe
'#update_repository_size'
do
describe
'#update_repository_size'
do
before
do
before
do
allow
(
project
.
repository
).
to
receive
(
:size
).
and_return
(
12
.
megabytes
)
allow
(
project
.
repository
).
to
receive
(
:size
).
and_return
(
12
)
statistics
.
update_repository_size
statistics
.
update_repository_size
end
end
...
...
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