Right now I have the following:
<% if !@thread.nil? && @thread.name == 'X' || @thread.name == 'Y' %>
....
The problem here is that I believe regardless if !@thread.nil?, @thread.name is still be called which is causing errors.
What’s the right way to write this so it’s like:
<% if !@thread.nil? && @thread.name == ('X' || 'Y') %>
Some type of contained in a list? for the thread.name?
Thanks
if !@thread.nil? && ['x','Y'].include?(@thread.name)