rails/rails — pull request #5572 by Empact (2012-03-25 05:28:08+00:00)
Title: Update ActionDispatch::Request#xml_http_request? to match its behavior regarding return values

The docs say this returns true on success, which it doesn't.

As noted in the debate about this method (see #5329), plenty of core library interrogative methods return values other then true and false, but from my checks they also consistently and correctly document what is returned.

E.g. see:
http://ruby-doc.org/core-1.9.3/FileTest.html#method-i-world_writable-3F
http://ruby-doc.org/core-1.9.3/FileTest.html#method-i-world_readable-3F
http://ruby-doc.org/core-1.9.3/File.html#method-c-size-3F
http://ruby-doc.org/core-1.9.3/File.html#method-c-world_readable-3F
http://ruby-doc.org/core-1.9.3/Kernel.html#method-i-autoload-3F

Incidentally, these returned values all have additional informational content beyond "I am a truthy stand-in for true".