Skip to content

Commit 31db419

Browse files
authored
Update annotate_models.rb
Update quote method to account for default values that are objects that implement the `to_s` method
1 parent 5d01c41 commit 31db419

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/annotate/annotate_models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def quote(value)
107107
when BigDecimal then value.to_s('F')
108108
when Array then value.map { |v| quote(v) }
109109
else
110-
value.inspect
110+
value.respond_to?(:to_s) ? value.to_s.inspect : value.inspect
111111
end
112112
end
113113

0 commit comments

Comments
 (0)