Skip to content

Commit

Permalink
Refs #29991 - Move settings into initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren authored and ekohl committed Sep 10, 2024
1 parent 059506f commit fbbf6c6
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 25 deletions.
9 changes: 0 additions & 9 deletions app/registries/foreman/settings.rb

This file was deleted.

4 changes: 4 additions & 0 deletions config/initializers/6_zeitwerk.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Rails.autoloaders.main.ignore(
Rails.root.join('lib/generators'),
Rails.root.join('lib/tasks')
)
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
setting('websockets_encrypt',
type: :boolean,
description: N_("VNC/SPICE websocket proxy console access encryption (websockets_ssl_key/cert setting required)"),
default: !!SETTINGS[:require_ssl],
default: !!SETTINGS[:require_ssl], # rubocop:disable Style/DoubleNegation
full_name: N_('Websockets encryption'))
validates('websockets_encrypt', ->(value) { !value || !(Setting["websockets_ssl_key"].empty? || Setting["websockets_ssl_cert"].empty?) }, message: N_("Unable to turn on websockets_encrypt, either websockets_ssl_key or websockets_ssl_cert is missing"))
validates('websockets_ssl_key', ->(value) { !Setting["websockets_encrypt"] || !value.empty? }, message: N_("Unable to unset websockets_ssl_key when websockets_encrypt is on"))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions config/initializers/foreman.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# stdlib dependencies
require 'English'

# Registries from app/registries/ that do not create a namespace
# should be loaded manually due to Zeitwerk
require 'foreman/access_permissions'
require 'foreman/settings'

Rails.application.config.before_initialize do
# load topbar
Menu::Loader.load
Expand Down
9 changes: 0 additions & 9 deletions config/initializers/zeitwerk.rb

This file was deleted.

1 change: 0 additions & 1 deletion test/unit/shared/access_permissions_test_base.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'foreman/access_control'
require 'foreman/access_permissions'

module AccessPermissionsTestBase
extend ActiveSupport::Concern
Expand Down

0 comments on commit fbbf6c6

Please sign in to comment.