Sha256: 16873e4c5d7921001e6a19c7f2cf7c8fdeac38dd7c5bdd7f0cff3057c0ad7437

Contents?: true

Size: 479 Bytes

Versions: 24

Compression:

Stored size: 479 Bytes

Contents

module Spree
  module Admin
    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
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
spree_backend-3.2.9 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.6 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.2.8 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.5 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.4 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.2.7 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.3 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.2.6 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.2 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.2.5 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.1 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.2.4 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.0 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.0.rc4 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.0.rc3 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.2.3 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.2.2 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.0.rc2 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.3.0.rc1 app/helpers/spree/admin/promotion_rules_helper.rb
spree_backend-3.2.1 app/helpers/spree/admin/promotion_rules_helper.rb