From: Robert Klemme Date: 2006-10-28T02:05:12+09:00 Subject: Re: Getting (var = false) to return true? Joe Ruby MUDCRAP-CE wrote: > Farrel Lifson wrote: >> On 27/10/06, Joe Ruby MUDCRAP-CE wrote: >>> false causes problems with it too). I know I can just simply do this: >>> >>> -- >>> Posted via http://www.ruby-forum.com/. >> def before_update >> @var = get_old_var_value || true >> end >> >> This returns get_old_var_value if it's not false (or nil) or true >> otherwise. Is that what you need? >> >> Farrel > > Nah, I need the value returned from the function to always be true. Hmm, > maybe this will work: > > def before_update > (@var = get_old_var_value) || true > end In that case the code is too complicated. Rather use def before_update @var = get_old_var_value true end There is no point in having "||" or "or" here. robert