Sha256: bbe48d9dca61f8f840539a66dad1a6345bd768b4fc1e0aab33901e1a4a5206e3
Contents?: true
Size: 516 Bytes
Versions: 96
Compression:
Stored size: 516 Bytes
Contents
# frozen_string_literal: true module Spree class Promotion < Spree::Base module Rules class UserLoggedIn < PromotionRule def applicable?(promotable) promotable.is_a?(Spree::Order) end def eligible?(order, _options = {}) unless order.user.present? eligibility_errors.add(:base, eligibility_error_message(:no_user_specified), error_code: :no_user_specified) end eligibility_errors.empty? end end end end end
Version data entries
96 entries across 96 versions & 1 rubygems