Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added an exception if calling id on nil to WhinyNil #584 [kevin-temp@…

…writesoon.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1472 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 817744a7257caa83f05cf8952838abddd5ac90c6 1 parent a9fd639
@dhh dhh authored
View
2  activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Added an exception if calling id on nil to WhinyNil #584 [kevin-temp@writesoon.com]
+
* Added Fix/Bignum#multiple_of? which returns true on 14.multiple_of?(7) and false on 16.multiple_of?(7) #1464 [Thomas Fuchs]
* Added even? and odd? to work with Bignums in addition to Fixnums #1464 [Thomas Fuchs]
View
4 activesupport/lib/active_support/whiny_nil.rb
@@ -18,6 +18,10 @@ class NilClass
@@method_class_map[method.to_sym] = klass
end
end
+
+ def id
+ raise "Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id"
+ end
private
def method_missing(method, *args, &block)
Please sign in to comment.
Something went wrong with that request. Please try again.