Closed raphaelm closed 6 years ago
LGTM, but let's Ruby it up:
if
is actually not needed. present?
simply checks if nil, empty string or just whitespace. Interpolating nil
just works, so "#{prod.named_size(item)}"
becomes ""
. Only difference would be whitespace, but I guess that neither happens nor would prawn render it.size = prod.named_size(item) || ""
to ensure it's always a string.double space instead of tabs :)
Fixed!
the if is actually not needed. present? simply checks if nil, empty string or just whitespace. Interpolating nil just works, so "#{prod.named_size(item)}" becomes "". Only difference would be whitespace, but I guess that neither happens nor would prawn render it.
Fixed!
If you want to increase the Ruby to 11, you can also just size = prod.named_size(item) || "" to ensure it's always a string.
I did not do this for now as I have no idea about the implications of requiring Ruby 11 and if we do so already 😉
This fixes #5