From: Hal Fulton Date: 2006-11-11T10:26:04+09:00 Subject: Re: Beginner question: testing for either condition? Taylor Strait wrote: > I want to check two conditions. If EITHER of them are true I want to > proceed. Unfortunately what I have is returning true no matter what: > > if (@unit.custodian_id == session[:person_id]) or (session[:person_role] > == 'admin') > > How can I test for EITHER condition without repeating myeself? Is my > only solution to use elsif? > I don't see what is wrong here. Are you sure your data are exactly what you think? Trying rewriting as an else and see if it does what you expect... and we'll tell if in fact the code is equivalent... Hal