diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 551a1006635099dcfb403993cded78b7f2bcf5ac..d3f194c65e8c1f147bbd2c18722d559210ec11f8 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added Object#blank? -- see http://redhanded.hobix.com/inspect/objectBlank.html #783 [_why the lucky stiff] + * Added inflection rules for "sh" words, like "wish" and "fish" #755 [phillip@pjbsoftware.com] * Fixed an exception when using Ajax based requests from Safari because Safari appends a \000 to the post body. Symbols can't have \000 in them so indifferent access would throw an exception in the constructor. Indifferent hashes now use strings internally instead. #746 [Tobias Luetke] diff --git a/activesupport/lib/active_support/core_ext/object_and_class.rb b/activesupport/lib/active_support/core_ext/object_and_class.rb index 59a463ae293a4041fd562c85f20e3ee6423fcdef..eb54f79534992bd20662eb755ed2092f161ea521 100644 --- a/activesupport/lib/active_support/core_ext/object_and_class.rb +++ b/activesupport/lib/active_support/core_ext/object_and_class.rb @@ -11,6 +11,16 @@ def subclasses_of(superclass) end subclasses end + + def blank? + if respond_to? :empty? + empty? + elsif respond_to? :zero? + zero? + else + !self + end + end end class Class #:nodoc: