Sha256: a6d6cd9b8810d019a2391f8f4e47c64b03938544478b405c97d64adaa580f951
Contents?: true
Size: 401 Bytes
Versions: 6
Compression:
Stored size: 401 Bytes
Contents
module Spree class LoyaltyPointsDebitTransaction < LoyaltyPointsTransaction after_create :update_user_balance before_create :update_balance private def update_user_balance user.decrement(:loyalty_points_balance, loyalty_points) user.save! end def update_balance self.balance = user.loyalty_points_balance - loyalty_points end end end
Version data entries
6 entries across 6 versions & 1 rubygems