Skip to content

Commit

Permalink
Moved from blocks to a decorator.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Jul 11, 2015
1 parent 84452b5 commit afe258e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
@@ -0,0 +1,7 @@
ApplicationController.class_eval do
include Refinery::Pages::InstanceMethods
helper Refinery::Pages::ContentPagesHelper

include Refinery::ApplicationController
helper Refinery::Core::Engine.helpers
end
@@ -0,0 +1,4 @@
Refinery::AdminController.class_eval do
include Refinery::Pages::Admin::InstanceMethods
helper Refinery::Pages::ContentPagesHelper
end
2 changes: 1 addition & 1 deletion core/lib/refinery/core.rb
Expand Up @@ -2,7 +2,7 @@
require 'truncate_html'
require 'will_paginate'
require 'refinery/i18n'
# require 'zilch/authorisation'
require 'zilch/authorisation'

module Refinery
module Core
Expand Down
3 changes: 0 additions & 3 deletions core/lib/refinery/core/engine.rb
Expand Up @@ -19,9 +19,6 @@ def register_decorators!
def refinery_inclusion!
before_inclusion_procs.each(&:call).tap{ |c| c.clear if Rails.application.config.cache_classes }

Refinery.include_once(::ApplicationController, Refinery::ApplicationController)
::ApplicationController.send :helper, Refinery::Core::Engine.helpers

after_inclusion_procs.each(&:call).tap{ |c| c.clear if Rails.application.config.cache_classes }
end
end
Expand Down
10 changes: 0 additions & 10 deletions pages/lib/refinery/pages/engine.rb
Expand Up @@ -8,16 +8,6 @@ class Engine < ::Rails::Engine

config.autoload_paths += %W( #{config.root}/lib )

before_inclusion do
::ApplicationController.send :helper, Refinery::Pages::ContentPagesHelper
Refinery::AdminController.send :helper, Refinery::Pages::ContentPagesHelper
end

after_inclusion do
Refinery.include_once(::ApplicationController, Refinery::Pages::InstanceMethods)
Refinery.include_once(Refinery::AdminController, Refinery::Pages::Admin::InstanceMethods)
end

initializer "refinery.pages register plugin" do
Refinery::Plugin.register do |plugin|
plugin.pathname = root
Expand Down

0 comments on commit afe258e

Please sign in to comment.