Sha256: 25d36214827d7bf6f38bde31adcc68d5ed93f83bc5a4f74ab51d6c0dd2981f6a

Contents?: true

Size: 850 Bytes

Versions: 1

Compression:

Stored size: 850 Bytes

Contents

# frozen_string_literal: true

module SolidusVolumePricing
  class Engine < Rails::Engine
    isolate_namespace ::Spree
    engine_name 'solidus_volume_pricing'

    initializer 'solidus_volume_pricing.preferences', before: 'spree.environment' do
      ::Spree::AppConfiguration.class_eval do
        preference :use_master_variant_volume_pricing, :boolean, default: false
        preference :volume_pricing_role, :string, default: 'wholesale'
      end
    end

    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end
      ::Spree::BackendConfiguration::CONFIGURATION_TABS << :volume_price_models
    end

    config.autoload_paths += %W(#{config.root}/lib)
    config.to_prepare(&method(:activate).to_proc)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_volume_pricing-1.0.0 lib/solidus_volume_pricing/engine.rb