From 4db810c18f4ab116baac958295187d5f79c7deab Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 23 Mar 2020 16:32:05 +0100 Subject: [PATCH] Fix taken space display for teams [SCI-4479] --- app/serializers/api/v1/team_serializer.rb | 4 ++++ app/views/users/settings/teams/show.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/serializers/api/v1/team_serializer.rb b/app/serializers/api/v1/team_serializer.rb index 62d13afae..225d1a6e2 100644 --- a/app/serializers/api/v1/team_serializer.rb +++ b/app/serializers/api/v1/team_serializer.rb @@ -5,6 +5,10 @@ module Api class TeamSerializer < ActiveModel::Serializer attributes :id, :name, :description, :space_taken belongs_to :created_by, serializer: UserSerializer + + def space_taken + object.storage_used.to_i + end end end end diff --git a/app/views/users/settings/teams/show.html.erb b/app/views/users/settings/teams/show.html.erb index fade85eab..8fe482819 100644 --- a/app/views/users/settings/teams/show.html.erb +++ b/app/views/users/settings/teams/show.html.erb @@ -50,7 +50,7 @@
- <%= "#{number_to_human_size(@team.space_taken)}" %> + <%= "#{number_to_human_size(@team.storage_used)}" %>