lib/simplec/engine.rb in simplec-0.3.0 vs lib/simplec/engine.rb in simplec-0.4.0
- old
+ new
@@ -1,18 +1,18 @@
-require 'simplec/action_controller/extensions'
-require 'simplec/action_view/helper'
-
module Simplec
class Engine < ::Rails::Engine
isolate_namespace Simplec
initializer "simplec_controller_extensions" do
ActiveSupport.on_load(:action_controller_base) {
- prepend Simplec::ActionController::Extensions
+ include Simplec::ActionController::Extensions
+ prepend Simplec::PageActionHelpers
helper Simplec::ActionView::Helper
}
- ActiveSupport.on_load(:active_record) {
- Dir["#{Rails.root}/app/models/page/*.rb"].each {|file| require_dependency file }
- }
+ ActiveSupport.on_load(:active_record) { Simplec.load_pages }
end
+ end
+
+ def self.load_pages
+ Dir["#{Rails.root}/app/models/page/*.rb"].each {|file| require_dependency file }
end
end