Sha256: 232247cc6deb0640f14422255bce9179bf69bc46db40d80c45c9bfb063cefbe9
Contents?: true
Size: 505 Bytes
Versions: 31
Compression:
Stored size: 505 Bytes
Contents
module Spree module Orders class FindCurrent def execute(user:, store:, **params) params = params.merge(store_id: store.id) order = incomplete_orders.find_by(params) return order unless order.nil? return if user.nil? incomplete_orders.order(created_at: :desc).find_by(store: store, user: user, currency: params[:currency]) end private def incomplete_orders Spree::Order.incomplete.not_canceled end end end end
Version data entries
31 entries across 31 versions & 1 rubygems