Sha256: d9424d16e16eb25abef2a8c60ce8569f349c8a761bc617045eea03ade3ba6036

Contents?: true

Size: 815 Bytes

Versions: 1

Compression:

Stored size: 815 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

    config.after_initialize do
      ::ApplicationHelper.include helpers
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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