kinduff/spree_reffiliate

View on GitHub
app/models/spree/promotion/rules/referred_promotion_rule.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Spree
  class Promotion
    module Rules
      class ReferredPromotionRule < Spree::PromotionRule
        def eligible?(order, options = {})
          return true if order.user and order.user.referred?
          false
        end
        def applicable?(promotable)
          promotable.is_a?(Spree::Order)
        end
      end
    end
  end
end