@@ 11,7 11,12 @@ class Transaction
def bonus
return unless bonus_amount.positive?
- new(@customer_id, "bonus_for_#{@id}", bonus_amount, "#{@note} bonus")
+ self.class.new(
+ @customer_id,
+ "bonus_for_#{@id}",
+ bonus_amount,
+ "#{@note} bonus"
+ )
end
def bonus_amount