new is on class

Stephen Paul Weber created

Change summary

lib/transaction.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Detailed changes

lib/transaction.rb 🔗

@@ -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