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

Apply zeitwerk autoload migration #69

Merged
merged 1 commit into from
Oct 9, 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
13 changes: 4 additions & 9 deletions lib/foreman_resource_quota/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ module ForemanResourceQuota
class Engine < ::Rails::Engine
engine_name 'foreman_resource_quota'

config.autoload_paths += Dir["#{config.root}/app/models/"]
config.autoload_paths += Dir["#{config.root}/app/controllers/"]
config.autoload_paths += Dir["#{config.root}/app/views/"]
config.autoload_paths += Dir["#{config.root}/app/services/foreman_resource_quota/"]
config.autoload_paths += Dir["#{config.root}/app/helpers/foreman_resource_quota/"]
config.autoload_paths += Dir["#{config.root}/lib/"]

# Add db migrations
initializer 'foreman_resource_quota.load_app_instance_data' do |app|
ForemanResourceQuota::Engine.paths['db/migrate'].existent.each do |path|
Expand All @@ -34,8 +27,10 @@ class Engine < ::Rails::Engine
end

# Plugin extensions
initializer 'foreman_resource_quota.register_plugin', before: :finisher_hook do |_app|
require 'foreman_resource_quota/register'
initializer 'foreman_resource_quota.register_plugin', before: :finisher_hook do |app|
app.reloader.to_prepare do
require 'foreman_resource_quota/register'
end
end

# Include concerns in this config.to_prepare block
Expand Down
2 changes: 1 addition & 1 deletion lib/foreman_resource_quota/register.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# rubocop: disable Metrics/BlockLength
Foreman::Plugin.register :foreman_resource_quota do
requires_foreman '>= 3.5.0'
requires_foreman '>= 3.13'
# Apipie
apipie_documented_controllers ["#{ForemanResourceQuota::Engine.root}" \
'/app/controllers/foreman_resource_quot/api/v2/*.rb']
Expand Down
Loading