Skip to content
  • Jean Boussier's avatar
    8c0b94b9
    Make NameError#missing_name work even for real Ruby NameError · 8c0b94b9
    Jean Boussier authored
    On constant missing Ruby call `#inspect` on the receiver to build
    the error message.
    
    For instance, the error message for `Foo::Bar` will be `"#{Foo.inspect}::Bar"`.
    
    And since Active Record override the model classes inspect method, this
    breaks `missing_name` assumptions.
    
    Until now it worked because missing_name was only called on errors
    raised by the classic autoloader, and the classic autoloader calls
    `#name` to build its error message.
    8c0b94b9
    Make NameError#missing_name work even for real Ruby NameError
    Jean Boussier authored
    On constant missing Ruby call `#inspect` on the receiver to build
    the error message.
    
    For instance, the error message for `Foo::Bar` will be `"#{Foo.inspect}::Bar"`.
    
    And since Active Record override the model classes inspect method, this
    breaks `missing_name` assumptions.
    
    Until now it worked because missing_name was only called on errors
    raised by the classic autoloader, and the classic autoloader calls
    `#name` to build its error message.
Loading