Sha256: c8241be1d1c247c7daa3599dca38820721fdca465f5d79cfab61adf17f150628
Contents?: true
Size: 484 Bytes
Versions: 34
Compression:
Stored size: 484 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)) end eligibility_errors.empty? end end end end end
Version data entries
34 entries across 34 versions & 2 rubygems