Module: Spree::Promotion::Rules::OptionValueWithNumerificationSupport

Defined in:
app/models/spree/promotion/rules/option_value.rb

Instance Method Summary collapse

Instance Method Details

#preferred_eligible_valuesObject


5
6
7
8
9
10
11
12
# File 'app/models/spree/promotion/rules/option_value.rb', line 5

def preferred_eligible_values
  values = super || {}
  Hash[values.keys.map(&:to_i).zip(
    values.values.map do |v|
      (v.is_a?(Array) ? v : v.split(',')).map(&:to_i)
    end
  )]
end