From 076547e3a236ee677ce63b644f100857fa610d1f Mon Sep 17 00:00:00 2001 From: Hiroshi Nakamura Date: Thu, 17 Feb 2011 19:10:26 +0900 Subject: [PATCH] Cosmetic: proper care about nil.id for Ruby impls. nil.id could not be 4. Just a exception message thing. % ~/ruby/rubinius-1.2.1/bin/rbx -ve 'p nil.object_id' rubinius 1.2.1 (1.8.7 release 2011-02-15 JI) [x86_64-unknown-linux-gnu] 53 --- activesupport/lib/active_support/whiny_nil.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/activesupport/lib/active_support/whiny_nil.rb b/activesupport/lib/active_support/whiny_nil.rb index 91ddef2..dbca92c 100644 --- a/activesupport/lib/active_support/whiny_nil.rb +++ b/activesupport/lib/active_support/whiny_nil.rb @@ -37,7 +37,7 @@ class NilClass # Raises a RuntimeError when you attempt to call +id+ on +nil+. def id - raise RuntimeError, "Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id", caller + raise RuntimeError, "Called id for nil, which would mistakenly be a number like 4 -- if you really wanted the id of nil, use object_id", caller end private -- 1.7.1