Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActiveSupport: nil.id could not be 4

#6444

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

Patch attached for activesupport/lib/active_support/whiny_nil.rb

Reported by nakahiro (at gmail) · February 17th, 2011 @ 10:19 AM

State: resolved
Milestone: none
Assigned to: Andrew White Andrew White
Importance: Low

Activity

  1. Andrew White
    Andrew White
    • State changed from new to open
    • Assigned user set to Andrew White
    • Importance changed from to Low

    I think you mean 'may not be 4' - 'could not' implies that it's never 4.

    Rather than making the message even more ambiguous I think we should just put the result of nil.object_id in there. You'll need a test that stubs nil.object_id to return a different value and asserts the error message is correct before I can apply the patch.

    February 17th, 2011 @ 01:57 PM

  2. Repository
    Repository
    • State changed from open to resolved

    (from [824107b2edb12ec275673c1f0e656a5e7ed6f4bf]) Report the correct value of nil.id in the exception message as different ruby implementations may have different values,
    for example Rubinius returns 53 for nil.id.

    [#6444 ActiveSupport: nil.id could not be 4 state:resolved] https://github.com/rails/rails/commit/824107b2edb12ec275673c1f0e656...

    March 6th, 2011 @ 03:32 PM

  3. Repository
    Repository

    (from [5e7ce47fb9ab50858fe067a6eb6c0462c5c5681e]) Report the correct value of nil.id in the exception message as different ruby implementations may have different values,
    for example Rubinius returns 53 for nil.id.

    [#6444 ActiveSupport: nil.id could not be 4 state:resolved] https://github.com/rails/rails/commit/5e7ce47fb9ab50858fe067a6eb6c0...

    March 6th, 2011 @ 03:32 PM