Module: ContainerExpirationPoliciesHelper

Defined in:
app/helpers/container_expiration_policies_helper.rb

Instance Method Summary collapse

Instance Method Details

#cadence_optionsObject


4
5
6
7
8
9
10
# File 'app/helpers/container_expiration_policies_helper.rb', line 4

def cadence_options
  ContainerExpirationPolicy.cadence_options.map do |key, val|
    { key: key.to_s, label: val }.tap do |base|
      base[:default] = true if key.to_s == '1d'
    end
  end
end

#keep_n_optionsObject


12
13
14
15
16
17
18
# File 'app/helpers/container_expiration_policies_helper.rb', line 12

def keep_n_options
  ContainerExpirationPolicy.keep_n_options.map do |key, val|
    { key: key, label: val }.tap do |base|
      base[:default] = true if key == 10
    end
  end
end

#older_than_optionsObject


20
21
22
23
24
25
26
# File 'app/helpers/container_expiration_policies_helper.rb', line 20

def older_than_options
  ContainerExpirationPolicy.older_than_options.map do |key, val|
    { key: key.to_s, label: val }.tap do |base|
      base[:default] = true if key.to_s == '90d'
    end
  end
end