Sha256: 481427a44387590956c701faa24bc6c08587dcdc12db8cca018e4a02110fbd76
Contents?: true
Size: 1.39 KB
Versions: 2
Compression:
Stored size: 1.39 KB
Contents
require 'rails/railtie' module ActiveModel class Railtie < Rails::Railtie generators do |app| Rails::Generators.configure!(app.config.generators) require "generators/resource_override" end end end module Draper class Railtie < Rails::Railtie ## # The `app/decorators` path is eager loaded # # This is the standard "Rails Way" to add paths from which constants # can be loaded. # config.after_initialize do |app| app.config.paths.add 'app/decorators', :eager_load => true end initializer "draper.extend_action_controller_base" do |app| ActiveSupport.on_load(:action_controller) do Draper::System.setup(self) end end initializer "draper.extend_action_mailer_base" do |app| ActiveSupport.on_load(:action_mailer) do Draper::System.setup(self) end end initializer "draper.extend_active_record_base" do |app| ActiveSupport.on_load(:active_record) do self.send(:include, Draper::ModelSupport) end end console do require 'action_controller/test_case' ApplicationController.new.view_context Draper::ViewContext.current.controller.request ||= ActionController::TestRequest.new Draper::ViewContext.current.request ||= Draper::ViewContext.current.controller.request Draper::ViewContext.current.params ||= {} end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
draper-0.17.0 | lib/draper/railtie.rb |
draper-0.16.0 | lib/draper/railtie.rb |