diff --git a/lib/active_admin.rb b/lib/active_admin.rb index 4cbbab6f752e..148f34468e2b 100644 --- a/lib/active_admin.rb +++ b/lib/active_admin.rb @@ -125,12 +125,12 @@ def wrap_block_for_active_support_notifications block end # Require things that don't support autoload -require "active_admin/engine" -require "active_admin/error" +require_relative "active_admin/engine" +require_relative "active_admin/error" # Require internal plugins -require "active_admin/batch_actions" -require "active_admin/filters" +require_relative "active_admin/batch_actions" +require_relative "active_admin/filters" # Require ORM-specific plugins -require "active_admin/orm/active_record" if defined? ActiveRecord +require_relative "active_admin/orm/active_record" if defined? ActiveRecord diff --git a/lib/active_admin/application.rb b/lib/active_admin/application.rb index 6597e2d77561..a4b8dfe81251 100644 --- a/lib/active_admin/application.rb +++ b/lib/active_admin/application.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require "active_admin/router" -require "active_admin/application_settings" -require "active_admin/namespace_settings" +require_relative "router" +require_relative "application_settings" +require_relative "namespace_settings" module ActiveAdmin class Application diff --git a/lib/active_admin/application_settings.rb b/lib/active_admin/application_settings.rb index b6ad0ecdc6e0..362705b21fd1 100644 --- a/lib/active_admin/application_settings.rb +++ b/lib/active_admin/application_settings.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/settings_node" +require_relative "settings_node" module ActiveAdmin class ApplicationSettings < SettingsNode diff --git a/lib/active_admin/batch_actions.rb b/lib/active_admin/batch_actions.rb index f0da87462212..91a362da38b5 100644 --- a/lib/active_admin/batch_actions.rb +++ b/lib/active_admin/batch_actions.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true ActiveAdmin.before_load do |app| - require "active_admin/batch_actions/resource_extension" - require "active_admin/batch_actions/controller" + require_relative "batch_actions/resource_extension" + require_relative "batch_actions/controller" # Add our Extensions ActiveAdmin::Resource.send :include, ActiveAdmin::BatchActions::ResourceExtension ActiveAdmin::ResourceController.send :include, ActiveAdmin::BatchActions::Controller - require "active_admin/batch_actions/views/batch_action_form" - require "active_admin/batch_actions/views/selection_cells" + require_relative "batch_actions/views/batch_action_form" + require_relative "batch_actions/views/selection_cells" end diff --git a/lib/active_admin/batch_actions/views/batch_action_form.rb b/lib/active_admin/batch_actions/views/batch_action_form.rb index 7790e74bd366..6dbf41f131b2 100644 --- a/lib/active_admin/batch_actions/views/batch_action_form.rb +++ b/lib/active_admin/batch_actions/views/batch_action_form.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/component" +require_relative "../../component" module ActiveAdmin module BatchActions diff --git a/lib/active_admin/batch_actions/views/selection_cells.rb b/lib/active_admin/batch_actions/views/selection_cells.rb index e118b0578c99..57d1afeb4cd1 100644 --- a/lib/active_admin/batch_actions/views/selection_cells.rb +++ b/lib/active_admin/batch_actions/views/selection_cells.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/component" +require_relative "../../component" module ActiveAdmin module BatchActions diff --git a/lib/active_admin/dynamic_settings_node.rb b/lib/active_admin/dynamic_settings_node.rb index e7f9c0ae9d1e..9227ea2db9eb 100644 --- a/lib/active_admin/dynamic_settings_node.rb +++ b/lib/active_admin/dynamic_settings_node.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "active_admin/dynamic_setting" -require "active_admin/settings_node" +require_relative "dynamic_setting" +require_relative "settings_node" module ActiveAdmin diff --git a/lib/active_admin/engine.rb b/lib/active_admin/engine.rb index 0eecded3d2c1..0d1930bc2bc2 100644 --- a/lib/active_admin/engine.rb +++ b/lib/active_admin/engine.rb @@ -35,7 +35,7 @@ class Engine < ::Rails::Engine end initializer "active_admin.routes" do - require "active_admin/helpers/routes/url_helpers" + require_relative "helpers/routes/url_helpers" end initializer "active_admin.deprecator" do |app| diff --git a/lib/active_admin/filters.rb b/lib/active_admin/filters.rb index 79abde582163..c69094f5d99b 100644 --- a/lib/active_admin/filters.rb +++ b/lib/active_admin/filters.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -require "active_admin/filters/dsl" -require "active_admin/filters/resource_extension" -require "active_admin/filters/formtastic_addons" -require "active_admin/filters/forms" -require "active_admin/helpers/optional_display" +require_relative "filters/dsl" +require_relative "filters/resource_extension" +require_relative "filters/formtastic_addons" +require_relative "filters/forms" +require_relative "helpers/optional_display" # Add our Extensions ActiveAdmin::ResourceDSL.send :include, ActiveAdmin::Filters::DSL diff --git a/lib/active_admin/filters/active.rb b/lib/active_admin/filters/active.rb index 0d894c7d65ee..b3879b53db1f 100644 --- a/lib/active_admin/filters/active.rb +++ b/lib/active_admin/filters/active.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/filters/active_filter" +require_relative "active_filter" module ActiveAdmin module Filters diff --git a/lib/active_admin/filters/resource_extension.rb b/lib/active_admin/filters/resource_extension.rb index 78a69d07e782..70f564b3e46b 100644 --- a/lib/active_admin/filters/resource_extension.rb +++ b/lib/active_admin/filters/resource_extension.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/filters/active" +require_relative "active" module ActiveAdmin module Filters diff --git a/lib/active_admin/localizers.rb b/lib/active_admin/localizers.rb index 9d5f8a44fd7c..a0a8f1f4b12b 100644 --- a/lib/active_admin/localizers.rb +++ b/lib/active_admin/localizers.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/localizers/resource_localizer" +require_relative "localizers/resource_localizer" module ActiveAdmin module Localizers diff --git a/lib/active_admin/menu_item.rb b/lib/active_admin/menu_item.rb index b4949896da88..e9b3f7076710 100644 --- a/lib/active_admin/menu_item.rb +++ b/lib/active_admin/menu_item.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'active_admin/view_helpers/method_or_proc_helper' +require_relative "view_helpers/method_or_proc_helper" module ActiveAdmin class MenuItem diff --git a/lib/active_admin/namespace.rb b/lib/active_admin/namespace.rb index 09f14915cb79..7c28032123a0 100644 --- a/lib/active_admin/namespace.rb +++ b/lib/active_admin/namespace.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/resource_collection" +require_relative "resource_collection" module ActiveAdmin diff --git a/lib/active_admin/namespace_settings.rb b/lib/active_admin/namespace_settings.rb index 449ef59ad0dd..83f2ea9e98cf 100644 --- a/lib/active_admin/namespace_settings.rb +++ b/lib/active_admin/namespace_settings.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/dynamic_settings_node" +require_relative "dynamic_settings_node" module ActiveAdmin class NamespaceSettings < DynamicSettingsNode diff --git a/lib/active_admin/orm/active_record.rb b/lib/active_admin/orm/active_record.rb index 37c166cd1971..7fa22c66cc70 100644 --- a/lib/active_admin/orm/active_record.rb +++ b/lib/active_admin/orm/active_record.rb @@ -3,4 +3,4 @@ ActiveAdmin::DatabaseHitDuringLoad.database_error_classes << ActiveRecord::StatementInvalid -require "active_admin/orm/active_record/comments" +require_relative "active_record/comments" diff --git a/lib/active_admin/orm/active_record/comments.rb b/lib/active_admin/orm/active_record/comments.rb index 0092e4eddcf3..5f0cc82e1dfb 100644 --- a/lib/active_admin/orm/active_record/comments.rb +++ b/lib/active_admin/orm/active_record/comments.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require "active_admin/orm/active_record/comments/views" -require "active_admin/orm/active_record/comments/namespace_helper" -require "active_admin/orm/active_record/comments/resource_helper" +require_relative "comments/views" +require_relative "comments/namespace_helper" +require_relative "comments/resource_helper" # Add the comments configuration ActiveAdmin::Application.inheritable_setting :comments, true diff --git a/lib/active_admin/orm/active_record/comments/views.rb b/lib/active_admin/orm/active_record/comments/views.rb index 94daaf79973f..f844704792b3 100644 --- a/lib/active_admin/orm/active_record/comments/views.rb +++ b/lib/active_admin/orm/active_record/comments/views.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true -require "active_admin/views" -require "active_admin/orm/active_record/comments/views/active_admin_comments" +require_relative "../../../views" +require_relative "views/active_admin_comments" diff --git a/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb b/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb index 47c056a94a72..fdaa962f55a8 100644 --- a/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +++ b/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/views" +require_relative "../../../../views" module ActiveAdmin module Comments diff --git a/lib/active_admin/resource.rb b/lib/active_admin/resource.rb index 2ccda9d1d1fc..7ef4ed4ec5c8 100644 --- a/lib/active_admin/resource.rb +++ b/lib/active_admin/resource.rb @@ -1,20 +1,20 @@ # frozen_string_literal: true -require "active_admin/view_helpers/method_or_proc_helper" -require "active_admin/resource/action_items" -require "active_admin/resource/attributes" -require "active_admin/resource/controllers" -require "active_admin/resource/menu" -require "active_admin/resource/page_presenters" -require "active_admin/resource/pagination" -require "active_admin/resource/routes" -require "active_admin/resource/naming" -require "active_admin/resource/scopes" -require "active_admin/resource/includes" -require "active_admin/resource/scope_to" -require "active_admin/resource/sidebars" -require "active_admin/resource/belongs_to" -require "active_admin/resource/ordering" -require "active_admin/resource/model" +require_relative "view_helpers/method_or_proc_helper" +require_relative "resource/action_items" +require_relative "resource/attributes" +require_relative "resource/controllers" +require_relative "resource/menu" +require_relative "resource/page_presenters" +require_relative "resource/pagination" +require_relative "resource/routes" +require_relative "resource/naming" +require_relative "resource/scopes" +require_relative "resource/includes" +require_relative "resource/scope_to" +require_relative "resource/sidebars" +require_relative "resource/belongs_to" +require_relative "resource/ordering" +require_relative "resource/model" module ActiveAdmin diff --git a/lib/active_admin/resource/action_items.rb b/lib/active_admin/resource/action_items.rb index a59e0bd663fa..308af2f4457b 100644 --- a/lib/active_admin/resource/action_items.rb +++ b/lib/active_admin/resource/action_items.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/helpers/optional_display" +require_relative "../helpers/optional_display" module ActiveAdmin diff --git a/lib/active_admin/resource/belongs_to.rb b/lib/active_admin/resource/belongs_to.rb index 45d771c763f3..4292b0fe4c61 100644 --- a/lib/active_admin/resource/belongs_to.rb +++ b/lib/active_admin/resource/belongs_to.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/resource" +require_relative "../resource" module ActiveAdmin class Resource diff --git a/lib/active_admin/resource/sidebars.rb b/lib/active_admin/resource/sidebars.rb index 53352320500c..7d73d44456b8 100644 --- a/lib/active_admin/resource/sidebars.rb +++ b/lib/active_admin/resource/sidebars.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "active_admin/helpers/optional_display" +require_relative "../helpers/optional_display" module ActiveAdmin diff --git a/lib/active_admin/views/components/scopes.rb b/lib/active_admin/views/components/scopes.rb index 99610e42ee32..c7f89ced7b55 100644 --- a/lib/active_admin/views/components/scopes.rb +++ b/lib/active_admin/views/components/scopes.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "active_admin/async_count" -require "active_admin/view_helpers/method_or_proc_helper" +require_relative "../../async_count" +require_relative "../../view_helpers/method_or_proc_helper" module ActiveAdmin module Views diff --git a/lib/activeadmin.rb b/lib/activeadmin.rb index 90e42f4981f4..9ebd064ec359 100644 --- a/lib/activeadmin.rb +++ b/lib/activeadmin.rb @@ -1,2 +1,2 @@ # frozen_string_literal: true -require "active_admin" +require_relative "active_admin" diff --git a/lib/generators/active_admin/devise/devise_generator.rb b/lib/generators/active_admin/devise/devise_generator.rb index 544902eb2a0f..2e764a6d6e29 100644 --- a/lib/generators/active_admin/devise/devise_generator.rb +++ b/lib/generators/active_admin/devise/devise_generator.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "active_admin/error" -require "active_admin/dependency" +require_relative "../../../active_admin/error" +require_relative "../../../active_admin/dependency" module ActiveAdmin module Generators