Class: Promotion::Actions::GiveStoreCredit

Inherits:
PromotionAction
  • Object
show all
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(options = {})
  if user = options[:user]
    user.store_credits.create(:amount => preferred_amount, :remaining_amount => preferred_amount,  :reason => "Promotion: #{promotion.name}")
  else
  end
end