Sha256: 42ffb11b0cf1ca97cd916aa9dc70991b23c39590920810d721698917494206d1

Contents?: true

Size: 440 Bytes

Versions: 35

Compression:

Stored size: 440 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| [ t("promotion_rule_types.#{name.demodulize.underscore}.name"), name] }
      options_for_select(options)
    end
 
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
spree_promo-1.1.3 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.0.6 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.1.2 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.1.2.rc1 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.1.1 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.1.0 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.0.4 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.1.0.rc2 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.1.0.rc1 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.0.3 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.0.2 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.0.1 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.0.0 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.0.0.rc4 app/helpers/spree/promotion_rules_helper.rb
spree_promo-1.0.0.rc3 app/helpers/spree/promotion_rules_helper.rb