lib/spree_faq/engine.rb in spree-faq-2.0.0 vs lib/spree_faq/engine.rb in spree-faq-2.0.1
- old
+ new
@@ -4,18 +4,17 @@
isolate_namespace Spree
engine_name 'spree_faq'
config.autoload_paths += %W(#{config.root}/lib)
- def self.activate
- Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
- Rails.configuration.cache_classes ? require(c) : load(c)
+ class << self
+ def activate
+ cache_klasses = %W(#{config.root}/app/**/*_decorator*.rb #{config.root}/app/overrides/*.rb)
+ Dir.glob(cache_klasses) do |klass|
+ Rails.configuration.cache_classes ? require(klass) : load(klass)
+ end
end
-
- Dir.glob(File.join(File.dirname(__FILE__), '../../app/overrides/*.rb')) do |c|
- Rails.configuration.cache_classes ? require(c) : load(c)
- end
end
- config.to_prepare &method(:activate).to_proc
+ config.to_prepare(&method(:activate).to_proc)
end
-end
\ No newline at end of file
+end