"and" and "or" have much lower precedence than "&&" and "||", mostly to allow for natural language constructs like:
res = may_return_nil() or raise "Oops, we got a nil!"
Hope that helps.
James Edward Gray II
···
On Aug 28, 2006, at 8:45 AM, Harold Hausman wrote:
Not to highjack this thread or anything, but what's the difference
between '||' and 'or' ?
???
Can someone tell me what horrible thing Rails is doing to the language, there?
How is @params[:per_page].to_i becoming false?
Kirk Haines
···
On Mon, 28 Aug 2006, Nicolas Blanco wrote:
I tried :
per_page = @params[:per_page].to_i > 0 ? @params[:per_page] : 20
but in this case if @params[:per_page] = 'blahblah' it works, I get 20
in per_page but if @params[:per_page] = 6 or another integer I get :
undefined method `>' for false:FalseClass
from Rails...