I am storing in DB table data. In a column could be the value NULL and a string. And I can’t to find a condition, when is a string -> print this string, when is NULL, do something else…
I am trying something like this:
if @optional.logo.size > 3 && !@optional.logo.nil?
...In table is a STRING...
else
...In table is NULL...
end
but this is wrong… Can anyone help me, please, how to fix it?
Thanks you
You’ll have to test for nil first because a nil object will not have the
sizeproperty.