Commit fb08198b authored by Kamil Trzcinski's avatar Kamil Trzcinski

Rename shared_runners_minutes_quota? to shared_runners_minutes_limit_enabled?

parent a4ae95ad
...@@ -6,8 +6,8 @@ module EE ...@@ -6,8 +6,8 @@ module EE
module Build module Build
extend ActiveSupport::Concern extend ActiveSupport::Concern
def shared_runners_minutes_quota? def shared_runners_minutes_limit_enabled?
runner && runner.shared? && project.shared_runners_minutes_quota? runner && runner.shared? && project.shared_runners_minutes_limit_enabled?
end end
end end
end end
...@@ -10,14 +10,14 @@ module EE ...@@ -10,14 +10,14 @@ module EE
delegate :shared_runners_minutes, :shared_runners_minutes_last_reset, delegate :shared_runners_minutes, :shared_runners_minutes_last_reset,
to: :project_metrics, allow_nil: true to: :project_metrics, allow_nil: true
delegate :shared_runners_minutes_limit_enabled?, :actual_shared_runners_minutes_limit, delegate :actual_shared_runners_minutes_limit,
:shared_runners_minutes_used?, to: :namespace :shared_runners_minutes_used?, to: :namespace
has_one :project_metrics, dependent: :destroy has_one :project_metrics, dependent: :destroy
end end
def shared_runners_minutes_quota? def shared_runners_minutes_limit_enabled?
!public? && shared_runners_enabled? !public? && shared_runners_enabled? && namespace.shared_runners_minutes_limit_enabled?
end end
def shared_runners def shared_runners
......
class UpdateBuildMinutesService < BaseService class UpdateBuildMinutesService < BaseService
def execute(build) def execute(build)
return unless build.shared_runners_minutes_quota? return unless build.shared_runners_minutes_limit_enabled?
return unless build.complete? return unless build.complete?
return unless build.duration return unless build.duration
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
%strong %strong
- if project.shared_runners_enabled? - if project.shared_runners_enabled?
Enabled Enabled
- if project.shared_runners_minutes_quota?
- if project.shared_runners_minutes_limit_enabled? - if project.shared_runners_minutes_limit_enabled?
- limit = project.actual_shared_runners_minutes_limit.to_i - limit = project.actual_shared_runners_minutes_limit.to_i
(Limited to #{limit} minutes per month) (Limited to #{limit} minutes per month)
......
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