Class: Credit
- Inherits:
-
Adjustment
- Object
- ActiveRecord::Base
- Adjustment
- Credit
- Defined in:
- app/models/credit.rb
Instance Method Summary collapse
Methods inherited from Adjustment
Instance Method Details
#calculate_adjustment ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'app/models/credit.rb', line 4 def calculate_adjustment if adjustment_source case adjustment_source_type when "Coupon" calculate_coupon_credit else super end end end |
#inverse_amount ⇒ Object
15 16 17 18 |
# File 'app/models/credit.rb', line 15 def inverse_amount x = self.amount > 0 ? -1 : 1 self.amount = self.amount * x end |