Class: Promotion::Actions::GiveStoreCredit
- Inherits:
-
PromotionAction
- Object
- PromotionAction
- Promotion::Actions::GiveStoreCredit
- Defined in:
- app/models/promotion/actions/give_store_credit.rb
Instance Method Summary collapse
Instance Method Details
#perform(options = {}) ⇒ Object
4 5 6 7 8 9 |
# File 'app/models/promotion/actions/give_store_credit.rb', line 4 def perform( = {}) if user = [:user] user.store_credits.create(:amount => preferred_amount, :remaining_amount => preferred_amount, :reason => "Promotion: #{promotion.name}") else end end |