Sha256: 0ed27c3e6d84e3fde1893392f0029dcfcabda7e5342ab2c8596f68d35f03daf6

Contents?: true

Size: 642 Bytes

Versions: 6

Compression:

Stored size: 642 Bytes

Contents

module Draper
  class System
    def self.app_local_decorator_glob
      'app/decorators/**/*_decorator.rb'
    end

    def self.load_app_local_decorators
      decorator_files = Dir[ "#{ Rails.root }/#{ app_local_decorator_glob }" ]
      decorator_files.each { |d| require_dependency d }
    end

    def self.setup(component)
      if component == :action_controller
        ActionController::Base.send(:include, Draper::ViewContextFilter)
        ActionController::Base.extend(Draper::HelperSupport)
      elsif component == :action_mailer
        ActionMailer::Base.send(:include, Draper::ViewContextFilter)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
draper-0.14.0 lib/draper/system.rb
draper-0.12.3 lib/draper/system.rb
draper-0.12.2 lib/draper/system.rb
draper-0.13.0 lib/draper/system.rb
draper-0.12.1 lib/draper/system.rb
draper-0.12.0 lib/draper/system.rb