Skip to content

Commit

Permalink
Merge pull request #276 from sseago/per_volume_gigabytes
Browse files Browse the repository at this point in the history
Bug 1506987: per_volume_gigabytes_used definition is missing
  • Loading branch information
mansam authored Apr 19, 2018
2 parents 2fae362 + 6601f8b commit 6c0ac99
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ def gigabytes_quota_used
.sum(:size) / 1_073_741_824
end

def per_volume_gigabytes_quota_used
max_used = CloudVolume.where(:cloud_tenant_id => cloud_tenant_id)
.maximum(:size)
max_used.nil? ? 0 : max_used / 1_073_741_824
end

def backups_quota_used
CloudVolumeBackup.joins(:cloud_volume)
.where("cloud_volumes.cloud_tenant_id" => cloud_tenant_id).count
Expand Down

0 comments on commit 6c0ac99

Please sign in to comment.