diff --git a/lib/foreman_resource_quota/exceptions.rb b/app/lib/foreman_resource_quota/exceptions.rb similarity index 100% rename from lib/foreman_resource_quota/exceptions.rb rename to app/lib/foreman_resource_quota/exceptions.rb diff --git a/lib/foreman_resource_quota/engine.rb b/lib/foreman_resource_quota/engine.rb index 3492aa2..0e96649 100644 --- a/lib/foreman_resource_quota/engine.rb +++ b/lib/foreman_resource_quota/engine.rb @@ -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| @@ -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 diff --git a/lib/foreman_resource_quota/register.rb b/lib/foreman_resource_quota/register.rb index 9cae950..63051c3 100644 --- a/lib/foreman_resource_quota/register.rb +++ b/lib/foreman_resource_quota/register.rb @@ -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']