app/models/unidom/order/order_item.rb in unidom-order-1.5.2 vs app/models/unidom/order/order_item.rb in unidom-order-1.5.3
- old
+ new
@@ -16,10 +16,10 @@
belongs_to :order, class_name: 'Unidom::Order::Order'
belongs_to :ordered, polymorphic: true
belongs_to :placer, polymorphic: true
- scope :order_is, ->(order) { where order_id: (order.respond_to?(:id) ? order.id : order) }
+ scope :order_is, ->(order) { where order: order }
scope :ordered_is, ->(ordered) { where ordered: ordered }
scope :placed_by, ->(placer) { where placer: placer }
##
# 订购商品 ordered ,放入订单 of 。订购者为 by ,缺省为订单的下单者。单价为 unit_price ,缺省值为 0 。数量为 quantity ,缺省值为 1。如: