Module: ChronicDurationAttribute

Extended by:
ActiveSupport::Concern
Included in:
ApplicationSetting, Ci::BuildMetadata, Ci::Runner, Project
Defined in:
app/models/concerns/chronic_duration_attribute.rb

Instance Method Summary collapse

Instance Method Details

#chronic_duration_attributesObject


33
34
35
# File 'app/models/concerns/chronic_duration_attribute.rb', line 33

def chronic_duration_attributes
  @chronic_duration_attributes ||= {}
end

#output_chronic_duration_attribute(source_attribute) ⇒ Object


37
38
39
40
# File 'app/models/concerns/chronic_duration_attribute.rb', line 37

def output_chronic_duration_attribute(source_attribute)
  value = attributes[source_attribute.to_s]
  ChronicDuration.output(value, format: :short) if value
end