Commit 04ecce95 authored by Mike Greiling's avatar Mike Greiling

remove redundant integer typecasting

parent ddb3a56b
module EE module EE
module GroupsHelper module GroupsHelper
def group_shared_runner_limits_quota(group) def group_shared_runner_limits_quota(group)
used = group.shared_runners_minutes.to_i used = group.shared_runners_minutes
if group.shared_runners_minutes_limit_enabled? if group.shared_runners_minutes_limit_enabled?
limit = group.actual_shared_runners_minutes_limit limit = group.actual_shared_runners_minutes_limit
...@@ -19,7 +19,7 @@ module EE ...@@ -19,7 +19,7 @@ module EE
def group_shared_runner_limits_percent_used(group) def group_shared_runner_limits_percent_used(group)
return 0 unless group.shared_runners_minutes_limit_enabled? return 0 unless group.shared_runners_minutes_limit_enabled?
100 * group.shared_runners_minutes.to_i / group.actual_shared_runners_minutes_limit 100 * group.shared_runners_minutes / group.actual_shared_runners_minutes_limit
end end
def group_shared_runner_limits_progress_bar(group) def group_shared_runner_limits_progress_bar(group)
......
...@@ -188,7 +188,7 @@ class Namespace < ActiveRecord::Base ...@@ -188,7 +188,7 @@ class Namespace < ActiveRecord::Base
def shared_runners_minutes_used? def shared_runners_minutes_used?
shared_runners_minutes_limit_enabled? && shared_runners_minutes_limit_enabled? &&
shared_runners_minutes.to_i >= actual_shared_runners_minutes_limit shared_runners_minutes >= actual_shared_runners_minutes_limit
end end
def full_name def full_name
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
= project_icon(project, alt: '', class: 'avatar project-avatar s20') = project_icon(project, alt: '', class: 'avatar project-avatar s20')
%strong= link_to project.name, project %strong= link_to project.name, project
%td %td
= project.shared_runners_minutes.to_i = project.shared_runners_minutes
- if @projects.blank? - if @projects.blank?
%tr %tr
%td{colspan: 2} %td{colspan: 2}
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
Runners page Runners page
- if @build.project.namespace.shared_runners_minutes_used? - if @build.project.namespace.shared_runners_minutes_used?
- quota_used = @build.project.namespace.shared_runners_minutes.to_i - quota_used = @build.project.namespace.shared_runners_minutes
- quota_limit = @build.project.namespace.actual_shared_runners_minutes_limit - quota_limit = @build.project.namespace.actual_shared_runners_minutes_limit
.bs-callout.bs-callout-warning .bs-callout.bs-callout-warning
%p %p
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment