Sha256: a772a71b02b13b737cb153adc21b0a82c5d98257760a6aede28bbb3c6ac55174
Contents?: true
Size: 479 Bytes
Versions: 112
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
112 entries across 112 versions & 1 rubygems