Sha256: 9f47424d247bce3580a6d9bc210b0937186c47173395dc66ccf9cb0ac89cc314

Contents?: true

Size: 1.45 KB

Versions: 24

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true
module Alchemy
  class Engine < Rails::Engine
    isolate_namespace Alchemy
    engine_name "alchemy"
    config.mount_at = "/"

    initializer "alchemy.lookup_context" do
      Alchemy::LOOKUP_CONTEXT = ActionView::LookupContext.new(Rails.root.join("app", "views", "alchemy"))
    end

    initializer "alchemy.dependency_tracker" do
      [:erb, :slim, :haml].each do |handler|
        ActionView::DependencyTracker.register_tracker(handler, CacheDigests::TemplateTracker)
      end
    end

    initializer "alchemy.non_digest_assets" do
      NonStupidDigestAssets.whitelist += [/^tinymce\//]
    end

    # Gutentag downcases all tgas before save.
    # We support having tags with uppercase characters.
    # The Gutentag search is case insensitive.
    initializer "alchemy.gutentag_normalizer" do
      Gutentag.normaliser = ->(value) { value.to_s }
    end

    # Custom Ransack sort arrows
    initializer "alchemy.ransack" do
      Ransack.configure do |config|
        config.custom_arrows = {
          up_arrow: '<i class="fa fas fa-xs fa-arrow-up"></i>',
          down_arrow: '<i class="fa fas fa-xs fa-arrow-down"></i>',
        }
      end
    end

    initializer "alchemy.userstamp" do
      if Alchemy.user_class
        ActiveSupport.on_load(:active_record) do
          Alchemy.user_class.model_stamper
          Alchemy.user_class.stampable(stamper_class_name: Alchemy.user_class_name)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
alchemy_cms-5.1.7 lib/alchemy/engine.rb
alchemy_cms-5.2.3 lib/alchemy/engine.rb
alchemy_cms-6.0.0.pre.rc2 lib/alchemy/engine.rb
alchemy_cms-5.1.6 lib/alchemy/engine.rb
alchemy_cms-5.2.2 lib/alchemy/engine.rb
alchemy_cms-5.1.5 lib/alchemy/engine.rb
alchemy_cms-6.0.0.pre.rc1 lib/alchemy/engine.rb
alchemy_cms-6.0.0.pre.b6 lib/alchemy/engine.rb
alchemy_cms-6.0.0.pre.b5 lib/alchemy/engine.rb
alchemy_cms-6.0.0.pre.b4 lib/alchemy/engine.rb
alchemy_cms-6.0.0.b3 lib/alchemy/engine.rb
alchemy_cms-6.0.0.b2 lib/alchemy/engine.rb
alchemy_cms-6.0.0.b1 lib/alchemy/engine.rb
alchemy_cms-5.2.1 lib/alchemy/engine.rb
alchemy_cms-5.1.4 lib/alchemy/engine.rb
alchemy_cms-5.1.3 lib/alchemy/engine.rb
alchemy_cms-5.2.0 lib/alchemy/engine.rb
alchemy_cms-5.2.0.rc1 lib/alchemy/engine.rb
alchemy_cms-5.2.0.b1 lib/alchemy/engine.rb
alchemy_cms-5.1.2 lib/alchemy/engine.rb