Changeset 1660
- Timestamp:
- 07/04/05 09:54:30 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/lib/active_support/whiny_nil.rb
r1507 r1660 20 20 21 21 def id 22 raise "Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id"22 raise RuntimeError, "Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id", caller 23 23 end 24 24 … … 26 26 def method_missing(method, *args, &block) 27 27 if @@method_class_map.include?(method) 28 raise_nil_warning_for @@method_class_map[method] 28 raise_nil_warning_for @@method_class_map[method], caller 29 29 else 30 30 super … … 32 32 end 33 33 34 def raise_nil_warning_for(klass )35 raise NoMethodError, NIL_WARNING_MESSAGE % klass 34 def raise_nil_warning_for(klass, with_caller = nil) 35 raise NoMethodError, NIL_WARNING_MESSAGE % klass, with_caller || caller 36 36 end 37 37