diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-21 16:36:40 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-21 16:36:40 +0000 |
commit | 817744a7257caa83f05cf8952838abddd5ac90c6 (patch) | |
tree | 3aa7dd9371b8d12b5a3348d869bfa4e21008fb80 /activesupport/lib | |
parent | a9fd639adf44cb17c6e3cd4f82d0025c8a7dcb64 (diff) | |
download | rails-817744a7257caa83f05cf8952838abddd5ac90c6.tar.gz rails-817744a7257caa83f05cf8952838abddd5ac90c6.tar.bz2 rails-817744a7257caa83f05cf8952838abddd5ac90c6.zip |
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
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/whiny_nil.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/whiny_nil.rb b/activesupport/lib/active_support/whiny_nil.rb index 4a83cd585e..3612c6acbf 100644 --- a/activesupport/lib/active_support/whiny_nil.rb +++ b/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) |