Revision cabe2c2e
Added by Ohad Levy about 7 years ago
app/models/concerns/host_params.rb | ||
---|---|---|
attr_reader :cached_host_params
|
||
|
||
def params
|
||
Foreman::Deprecation.renderer_deprecation('1.17', __method__, 'host_param') unless caller.first.match(/renderer\.rb.*host_param/)
|
||
Foreman::Deprecation.renderer_deprecation('1.17', __method__, 'host_param') unless caller.first =~ /renderer\.rb.*host_param/
|
||
host_params.update(lookup_keys_params)
|
||
end
|
||
|
||
... | ... | |
options = {:value => param.value,
|
||
:source => source,
|
||
:safe_value => param.safe_value }
|
||
if source != 'global'
|
||
options.merge!(:source_name => param.associated_label)
|
||
end
|
||
options[:source_name] = param.associated_label if source != 'global'
|
||
hp.update(Hash[param.name => include_source ? options : param.value])
|
||
end
|
||
hp
|
Also available in: Unified diff
Fixes #19700 - update rubocop rules
The following changes have been made:
- Performance/RedundantMerge:
changes lines such as:
```not_found_message.merge! :message => options```
to:
```not_found_message[:message] = options```
- converts str.match() to str =~ ()
- remove extra whitespaces etc.