app/models/setting/salt.rb in foreman_salt-12.0.0 vs app/models/setting/salt.rb in foreman_salt-13.0.0
- old
+ new
@@ -1,14 +1,13 @@
class Setting::Salt < Setting
- def self.load_defaults
- return unless super
+ def self.default_settings
+ [
+ set('salt_namespace_pillars', N_("Namespace Foreman pillars under 'foreman' key"), false),
+ set('salt_hide_run_salt_button', N_("Hide the Run Salt state.highstate button on the host details page"), false)
+ ]
+ end
- transaction do
- [
- set('salt_namespace_pillars', N_("Namespace Foreman pillars under 'foreman' key"), false),
- set('salt_hide_run_salt_button', N_("Hide the Run Salt state.highstate button on the host details page"), false)
- ].each { |s| self.create! s.update(:category => 'Setting::Salt') }
- Setting['salt_hide_run_salt_button'] = true if ForemanSalt.with_remote_execution?
- end
- true
+ def self.load_defaults
+ super
+ Setting['salt_hide_run_salt_button'] = true if ForemanSalt.with_remote_execution?
end
end