Commit 36753b78 authored by Tomasz Maczukin's avatar Tomasz Maczukin

Replace user_readable with human_readable

parent 4ce376c0
...@@ -91,7 +91,7 @@ module Ci ...@@ -91,7 +91,7 @@ module Ci
after_commit :update_project_statistics_after_save, on: [:create, :update] after_commit :update_project_statistics_after_save, on: [:create, :update]
after_commit :update_project_statistics, on: :destroy after_commit :update_project_statistics, on: :destroy
chronic_duration_attr_reader :used_timeout_user_readable, :used_timeout chronic_duration_attr_reader :used_timeout_human_readable, :used_timeout
class << self class << self
# This is needed for url_for to work, # This is needed for url_for to work,
......
...@@ -9,7 +9,7 @@ module Ci ...@@ -9,7 +9,7 @@ module Ci
ONLINE_CONTACT_TIMEOUT = 1.hour ONLINE_CONTACT_TIMEOUT = 1.hour
UPDATE_DB_RUNNER_INFO_EVERY = 40.minutes UPDATE_DB_RUNNER_INFO_EVERY = 40.minutes
AVAILABLE_SCOPES = %w[specific shared active paused online].freeze AVAILABLE_SCOPES = %w[specific shared active paused online].freeze
FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_job_timeout_user_readable].freeze FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_job_timeout_human_readable].freeze
has_many :builds has_many :builds
has_many :runner_projects, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :runner_projects, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
...@@ -52,7 +52,7 @@ module Ci ...@@ -52,7 +52,7 @@ module Ci
cached_attr_reader :version, :revision, :platform, :architecture, :contacted_at, :ip_address cached_attr_reader :version, :revision, :platform, :architecture, :contacted_at, :ip_address
chronic_duration_attr :maximum_job_timeout_user_readable, :maximum_job_timeout chronic_duration_attr :maximum_job_timeout_human_readable, :maximum_job_timeout
# Searches for runners matching the given query. # Searches for runners matching the given query.
# #
......
...@@ -6,7 +6,7 @@ class BuildDetailsEntity < JobEntity ...@@ -6,7 +6,7 @@ class BuildDetailsEntity < JobEntity
expose :pipeline, using: PipelineEntity expose :pipeline, using: PipelineEntity
expose :timeout, if: -> (*) { !build.used_timeout.nil? } do |build| expose :timeout, if: -> (*) { !build.used_timeout.nil? } do |build|
{ value: build.used_timeout_user_readable, { value: build.used_timeout_human_readable,
source: build.timeout_source } source: build.timeout_source }
end end
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
= runner.ip_address = runner.ip_address
%td %td
- if runner.defines_maximum_job_timeout? - if runner.defines_maximum_job_timeout?
= runner.maximum_job_timeout_user_readable = runner.maximum_job_timeout_human_readable
- else - else
n/a n/a
%td %td
......
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
.col-sm-10 .col-sm-10
= f.text_field :description, class: 'form-control' = f.text_field :description, class: 'form-control'
.form-group .form-group
= label_tag :maximum_job_timeout_user_readable, class: 'control-label' do = label_tag :maximum_job_timeout_human_readable, class: 'control-label' do
Maximum job timeout Maximum job timeout
.col-sm-10 .col-sm-10
= f.text_field :maximum_job_timeout_user_readable, class: 'form-control' = f.text_field :maximum_job_timeout_human_readable, class: 'form-control'
.help-block This timeout will take precedence when lower than Project-defined timeout .help-block This timeout will take precedence when lower than Project-defined timeout
.form-group .form-group
= label_tag :tag_list, class: 'control-label' do = label_tag :tag_list, class: 'control-label' do
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
%p.runner-description %p.runner-description
= runner.description = runner.description
- if runner.defines_maximum_job_timeout? - if runner.defines_maximum_job_timeout?
%p Maximum job timeout: #{runner.maximum_job_timeout_user_readable} %p Maximum job timeout: #{runner.maximum_job_timeout_human_readable}
- if runner.tag_list.present? - if runner.tag_list.present?
%p %p
- runner.tag_list.sort.each do |tag| - runner.tag_list.sort.each do |tag|
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
%td= @runner.description %td= @runner.description
%tr %tr
%td Maximum job timeout %td Maximum job timeout
%td= @runner.maximum_job_timeout_user_readable %td= @runner.maximum_job_timeout_human_readable
%tr %tr
%td Last contact %td Last contact
%td %td
......
...@@ -26,7 +26,7 @@ end ...@@ -26,7 +26,7 @@ end
describe 'ChronicDurationAttribute' do describe 'ChronicDurationAttribute' do
let(:source_field) {:maximum_job_timeout} let(:source_field) {:maximum_job_timeout}
let(:virtual_field) {:maximum_job_timeout_user_readable} let(:virtual_field) {:maximum_job_timeout_human_readable}
subject {Ci::Runner.new} subject {Ci::Runner.new}
it_behaves_like 'ChronicDurationAttribute reader' it_behaves_like 'ChronicDurationAttribute reader'
...@@ -35,7 +35,7 @@ end ...@@ -35,7 +35,7 @@ end
describe 'ChronicDurationAttribute - reader' do describe 'ChronicDurationAttribute - reader' do
let(:source_field) {:used_timeout} let(:source_field) {:used_timeout}
let(:virtual_field) {:used_timeout_user_readable} let(:virtual_field) {:used_timeout_human_readable}
subject {Ci::Build.new} subject {Ci::Build.new}
it "doesn't contain dynamically created writer method" do it "doesn't contain dynamically created writer method" do
......
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