Sha256: 95b54341ccb8d1d78d66fc7dd2b58297f60e451864f37e7457a5ab2d3575e615

Contents?: true

Size: 924 Bytes

Versions: 2

Compression:

Stored size: 924 Bytes

Contents

module Solder
  def self.config
    Rails.application.config.solder
  end

  class Engine < ::Rails::Engine
    isolate_namespace Solder

    config.solder = ActiveSupport::OrderedOptions.new
    config.solder[:around_action] = ->(_controller, action) { action.call }

    initializer "solder.check_caching" do |app|
      unless app.config.action_controller.perform_caching && app.config.cache_store != :null_store
        puts <<~WARN
          🧑‍🏭 Solder uses the Rails cache store to provide UI state persistence. Therefore, please make sure caching is enabled in your environment.

          To enable caching in development, run:
            rails dev:cache
        WARN

        exit false
      end
    end

    initializer "solder.helpers" do
      ActiveSupport.on_load(:action_controller_base) do
        include Solder::ApplicationHelper
        helper Solder::Engine.helpers
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solder-0.3.0 lib/solder/engine.rb~
solder-0.2.0 lib/solder/engine.rb