Sha256: ae3340c412f324f537709b3809e0d4ee47fbbf5334588575f1e0dfb5ba02e661
Contents?: true
Size: 402 Bytes
Versions: 6
Compression:
Stored size: 402 Bytes
Contents
module Spree class LoyaltyPointsCreditTransaction < LoyaltyPointsTransaction after_create :update_user_balance before_create :update_balance private def update_user_balance user.increment(: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