Sha256: 22e9449fa6e4877bfd3a0c809f979bb2bd948eff90714b76874092ef45852364

Contents?: true

Size: 416 Bytes

Versions: 41

Compression:

Stored size: 416 Bytes

Contents

# frozen_string_literal: true

module Spree
  module PromotionRulesHelper
    def options_for_promotion_rule_types(promotion)
      existing = promotion.rules.map { |rule| rule.class.name }
      rules = Rails.application.config.spree.promotions.rules.reject { |r| existing.include? r.name }
      options = rules.map { |rule| [rule.model_name.human, rule.name] }
      options_for_select(options)
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
solidus_backend-2.9.6 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.8.6 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.9.5 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.9.4 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.6.6 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.7.4 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.8.5 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.9.3 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.9.2 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.7.3 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.6.5 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.9.1 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.9.0 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.9.0.rc.1 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.8.4 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.8.3 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.7.2 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.6.4 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.8.2 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-2.8.1 app/helpers/spree/promotion_rules_helper.rb