lib/madmin/engine.rb in madmin-0.1.0 vs lib/madmin/engine.rb in madmin-0.1.1
- old
+ new
@@ -1,9 +1,12 @@
module Madmin
class Engine < ::Rails::Engine
- isolate_namespace Madmin
+ initializer "madmin.autoload", before: :set_autoload_paths do |app|
+ app.config.paths.add "app/madmin/resources", eager_load: true
+ app.config.paths.add "app/madmin/fields", eager_load: true
+ end
config.to_prepare do
- Dir.glob("#{Rails.root}/app/madmin/**/*.rb").each { |r| require_dependency(r) }
+ Madmin.resources = []
end
end
end