Module: ForemanNameGenerator::SettingsHelperExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/foreman_name_generator/settings_helper_extensions.rb

Instance Method Summary collapse

Instance Method Details

#value_with_name_generator(setting) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/concerns/foreman_name_generator/settings_helper_extensions.rb', line 9

def value_with_name_generator(setting)
  return value_without_name_generator(setting) unless ['name_generator_type'].include?(setting.name)

  case setting.name
  when "name_generator_type"
    edit_select(setting, :value, {:select_values => {
      'OFF' => "OFF",
      'MAC+RANDOM' => "MAC+RANDOM",
      'MAC' => "MAC",
      'RANDOM' => "RANDOM"
    }.to_json})
  end
end