I have a condition like:
if connection
if "name" == connection.name
...
end
end
connection may have nil value initially, so I am not able to check if connection && "name" == connection.name
How can I simplify the condition efficiently?
1 Answer