This project is archived and is in readonly mode.

#5286 ✓invalid
Rohit Arondekar

ActiveRecord::Base.abstract_class? should return false not nil

Reported by Rohit Arondekar | August 3rd, 2010 @ 03:51 PM | in 3.0.2

Although this doesn't break anything, but ActiveRecord::Base.abstract_class? returns nil when @abstract_class is not defined. This still works as nil and false are treated as false in conditionals. But Ruby methods ending with a ?, by convention should return true/false. The attached patch ensures that it does return false if @abstract_class is not defined.

IMHO no test was needed as the existing tests cover the functionality provided by the method.

Credit: Neeraj Singh for originally spotting the discrepancy.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages