我是Ruby On Rails的新手。我正在狂欢。
我正在尝试获取促销规则的值。这就是我到目前为止所得到的。
@freeShipping = Spree::Promotion.find(4)
@freeShippingRules = Spree::PromotionRule.where(promotion_id: @freeShipping.id)
abort( @freeShippingRules.preferred_amount_min )
我想从Spree :: Promotion :: Rules :: ItemTotal获取value_min和amount_max的值。问题在于它们存储在“首选项”字段中:
--- :amount_min: !ruby/object:BigDecimal 18:0.12E4 :operator_min: gt :amount_max: !ruby/object:BigDecimal 18:0.1E5 :operator_max: lt
如何获取amount_min和max-max值?
谢谢!