rails/rails — pull request #5316 by Jacobkg (2012-03-07 06:39:01+00:00)
Title: Update ActiveRecord::AttributeMethods#attribute_present? to return false for empty strings

Right now, attribute_present? returns true on empty strings, when the documentation says that it should return false:

# Returns true if the specified +attribute+ has been set by the user or by a database load and is neither
# nil nor empty? (the latter only applies to objects that respond to empty?, most notably Strings).

This change fixes the function to correctly return false for empty strings. Test is included.

Fixes #5314