Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37700 - Add Zeitwerk loader support #405

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions lib/foreman_puppet/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ class Engine < ::Rails::Engine
config.paths['db/migrate'] << 'db/migrate_foreman' if Gem::Dependency.new('', ">= #{ForemanPuppet::FOREMAN_DROP_MIGRATIONS_VERSION}").match?('', SETTINGS[:version].notag)
config.paths['config/routes.rb'].unshift('config/api_routes.rb')

initializer 'foreman_puppet.register_plugin', before: :finisher_hook do |_app|
require 'foreman_puppet/register'
initializer 'foreman_puppet.register_plugin', before: :finisher_hook do |app|
app.reloader.to_prepare do
require_relative 'register'
end
Apipie.configuration.checksum_path += ['/foreman_puppet/api/']
end

Expand All @@ -23,14 +25,10 @@ class Engine < ::Rails::Engine
SETTINGS[:foreman_puppet] = { assets: { precompile: ['foreman_puppet.scss'] } }
end

initializer 'foreman_puppet.patch_parameters' do
# Parameters should go ASAP as they need to be applied before they are included in core controller
Foreman::Controller::Parameters::TemplateCombination.include ForemanPuppet::Extensions::ParametersTemplateCombination
end

# Include concerns in this config.to_prepare block
# rubocop:disable Metrics/BlockLength
config.to_prepare do
Foreman::Controller::Parameters::TemplateCombination.include ForemanPuppet::Extensions::ParametersTemplateCombination
# Facets extenstion is applied too early - before the Hostgroup is complete
# We redefine thing, so we need to wait until complete definition of Hostgroup
# thus separate patching instead of using facet patching
Expand Down
2 changes: 1 addition & 1 deletion lib/foreman_puppet/register.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Foreman::Plugin.register :foreman_puppet do
requires_foreman '>= 3.7'
requires_foreman '>= 3.13'
register_gettext

# Add Global JS file for extending foreman-core components and routes
Expand Down