Permalink
Browse files

load frills even if in subdirs

  • Loading branch information...
1 parent 74b6d42 commit 4ca457b12b8d29c72bd49a22b6b1035a123b154e @moonmaster9000 committed May 13, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/frill/engine.rb
View
@@ -8,18 +8,22 @@ class Engine < Rails::Engine
require 'frill/rails'
end
+ config.before_initialize do |app|
+ app.config.paths.add 'app/decorators', :eager_load => true
+ end
+
config.to_prepare do
if Rails.env.development? && !Rails.application.config.cache_classes
Frill.reset!
- Frill::Engine.force_load Dir["#{Frill::Engine.root}/app/frills/*"]
- Frill::Engine.force_load Dir["#{Rails.root}/app/frills/*"]
+ Frill::Engine.force_load Dir["#{Frill::Engine.root}/app/frills/**/*"]
+ Frill::Engine.force_load Dir["#{Rails.root}/app/frills/**/*"]
end
end
def self.force_load files
files.each do |f|
- load f
+ require_dependency f
end
end
end

0 comments on commit 4ca457b

Please sign in to comment.