Module: ChronicDurationAttribute

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

Instance Method Summary collapse

Instance Method Details

#chronic_duration_attributesObject



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

def chronic_duration_attributes
  @chronic_duration_attributes ||= {}
end

#output_chronic_duration_attribute(source_attribute) ⇒ Object



42
43
44
45
# File 'app/models/concerns/chronic_duration_attribute.rb', line 42

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