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.

Cleaning abstract_class? method

#5388

Hi Guys,

This patch removes unnecessary code from abstract_class? method.

Reported by Thiago Pradi · August 16th, 2010 @ 11:50 PM

State: wontfix
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to wontfix
    • Importance changed from to Low

    This code

    defined?(@abstract_class) && @abstract_class == true
    

    Makes abstract_class? return true if and only if @abstract_class value is true.

    Also docs says you have to assign true to this value

    # Set this to true if this is an abstract class (see <tt>abstract_class?</tt>).
    attr_accessor :abstract_class
    

    So you're changing the semantics here and allowing things like abstract_class = "hello" to set the model as an abstract_class

    August 17th, 2010 @ 02:16 AM