Sha256: dbbede51661f874c1bb48d46473798f8232558ff28f357f134d74670d4abee48
Contents?: true
Size: 915 Bytes
Versions: 5
Compression:
Stored size: 915 Bytes
Contents
require "rails/railtie" module Trailblazer class Railtie < ::Rails::Railtie config.trailblazer = ActiveSupport::OrderedOptions.new ## Accept also an Array of controllers config.trailblazer.application_controller ||= %w[ActionController::Base ActionController::API] config.trailblazer.enable_tracing ||= false initializer "trailblazer.application_controller", before: "finisher_hook" do ActiveSupport.on_load(:action_controller) do |app| Trailblazer::Railtie.extend_application_controller!(app) end end def extend_application_controller!(app) controllers = Array(::Rails.application.config.trailblazer.application_controller).map(&:to_s) if controllers.include? app.to_s app.send :include, Trailblazer::Rails::Controller app.send :include, Trailblazer::Rails::Controller::Cell if defined?(::Cell) end app end end end
Version data entries
5 entries across 5 versions & 1 rubygems