Sha256: 164a4406d60d679c16fc3d22a47ded6367a2c7f22a91f962eb1a27ae6eb92563

Contents?: true

Size: 446 Bytes

Versions: 133

Compression:

Stored size: 446 Bytes

Contents

module Spree
  module PromotionRulesHelper

    def options_for_promotion_rule_types(promotion)
      existing = promotion.rules.map { |rule| rule.class.name }
      rule_names = Rails.application.config.spree.promotions.rules.map(&:name).reject{ |r| existing.include? r }
      options = rule_names.map { |name| [ Spree.t("promotion_rule_types.#{name.demodulize.underscore}.name"), name] }
      options_for_select(options)
    end
 
  end
end

Version data entries

133 entries across 133 versions & 2 rubygems

Version Path
spree_backend-3.1.14 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.13 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.12 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-1.2.3 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-1.1.4 app/helpers/spree/promotion_rules_helper.rb
solidus_backend-1.0.7 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.11 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.10 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.9 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.8 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.7 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.6 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.5 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.4 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.3 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.2 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.0.10 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.1 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.0 app/helpers/spree/promotion_rules_helper.rb
spree_backend-3.1.0.rc4 app/helpers/spree/promotion_rules_helper.rb