Skip to content

Commit

Permalink
fix output
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros committed Jun 13, 2024
1 parent 7c9643c commit e778778
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/dummy/app/models/song.rb
Original file line number Diff line number Diff line change
@@ -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"
%{#<Song id: #{id}, title: #{title}>}
end
end

0 comments on commit e778778

Please sign in to comment.