diff options
Diffstat (limited to 'app/models/ci/runner.rb')
-rw-r--r-- | app/models/ci/runner.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 690aa978716..d4e9217ff9f 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -35,6 +35,7 @@ module Ci AVAILABLE_SCOPES = (AVAILABLE_TYPES_LEGACY + AVAILABLE_TYPES + AVAILABLE_STATUSES).freeze FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_timeout_human_readable].freeze + MINUTES_COST_FACTOR_FIELDS = %i[public_projects_minutes_cost_factor private_projects_minutes_cost_factor].freeze ignore_column :is_shared, remove_after: '2019-12-15', remove_with: '12.6' @@ -137,6 +138,11 @@ module Ci numericality: { greater_than_or_equal_to: 600, message: 'needs to be at least 10 minutes' } + validates :public_projects_minutes_cost_factor, :private_projects_minutes_cost_factor, + allow_nil: false, + numericality: { greater_than_or_equal_to: 0.0, + message: 'needs to be non-negative' } + # Searches for runners matching the given query. # # This method uses ILIKE on PostgreSQL and LIKE on MySQL. |