From e778778dcb8e467ecd47c3389a51453dd8950de9 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Thu, 13 Jun 2024 16:09:50 +0100 Subject: [PATCH] fix output --- test/dummy/app/models/song.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/dummy/app/models/song.rb b/test/dummy/app/models/song.rb index 7c9dbf0..bd4aa53 100644 --- a/test/dummy/app/models/song.rb +++ b/test/dummy/app/models/song.rb @@ -1,2 +1,9 @@ class Song < ApplicationRecord + + def inspect + # this makes the output consistent across Ruby versions + title = self.title.present? ? "\"#{self.title}\"" : "nil" + id = self.id.present? ? self.id : "nil" + %{#} + end end