This has bitten me a couple times in the last few days. The Ruby “or” (or equals) operator appears to have a bug where, when used in an assignment, the first value is assigned rather than the results of the entire expression.
irb(main):001:0> x = false || true
irb(main):003:0> z = false or true
ruby version: ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1]
I would expect z to be true in that last example.