diff --git a/lib/discourse_data_explorer/engine.rb b/lib/discourse_data_explorer/engine.rb index 5da807a..0b42330 100644 --- a/lib/discourse_data_explorer/engine.rb +++ b/lib/discourse_data_explorer/engine.rb @@ -4,5 +4,8 @@ module ::DiscourseDataExplorer class Engine < ::Rails::Engine engine_name PLUGIN_NAME isolate_namespace DiscourseDataExplorer + config.autoload_paths << File.join(config.root, "lib") + scheduled_job_dir = "#{config.root}/app/jobs/scheduled" + config.to_prepare { Rails.autoloaders.main.eager_load_dir(scheduled_job_dir) } end end diff --git a/lib/report_generator.rb b/lib/discourse_data_explorer/report_generator.rb similarity index 100% rename from lib/report_generator.rb rename to lib/discourse_data_explorer/report_generator.rb diff --git a/lib/result_format_converter.rb b/lib/discourse_data_explorer/result_format_converter.rb similarity index 100% rename from lib/result_format_converter.rb rename to lib/discourse_data_explorer/result_format_converter.rb diff --git a/lib/result_to_markdown.rb b/lib/discourse_data_explorer/result_to_markdown.rb similarity index 100% rename from lib/result_to_markdown.rb rename to lib/discourse_data_explorer/result_to_markdown.rb diff --git a/plugin.rb b/plugin.rb index d62981d..6f74277 100644 --- a/plugin.rb +++ b/plugin.rb @@ -32,12 +32,6 @@ end require_relative "lib/discourse_data_explorer/engine" after_initialize do - require_relative "app/jobs/scheduled/delete_hidden_queries" - require_relative "lib/discourse_data_explorer/data_explorer" - require_relative "lib/discourse_data_explorer/parameter" - require_relative "lib/discourse_data_explorer/queries" - require_relative "lib/discourse_data_explorer/query_group_bookmarkable" - GlobalSetting.add_default(:max_data_explorer_api_reqs_per_10_seconds, 2) # Available options: @@ -77,9 +71,6 @@ after_initialize do { run_queries: { actions: %w[discourse_data_explorer/query#run], params: %i[id] } }, ) - require_relative "lib/report_generator" - require_relative "lib/result_to_markdown" - require_relative "lib/result_format_converter" reloadable_patch do if defined?(DiscourseAutomation) add_automation_scriptable("recurring_data_explorer_result_pm") do