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.

ActiveRecord::Base.scopes includes all scopes defined in all subclasses

#6439

ActiveRecord::Base.scopes which is defined as a class_attribute in NamedScope is shared by all classes that inherit from ActiveRecord::Base. ActiveRecord::Base#scope does not dup the scopes class_attribute hash for every class. I'm guessing having every model share every scope is not the intended functionality, but I may be missing something obvious. Attached is a patch for with a test and the code that makes that test pass.

Reported by rubymaverick · February 16th, 2011 @ 02:49 AM

State: committed
Milestone: 3.1
Assigned to: nobody
Importance: Low

Activity

  1. Aaron Patterson
    Aaron Patterson
    • State changed from new to committed
    • Milestone set to 3.1
    • Importance changed from to Low

    Applied, thanks!

    February 24th, 2011 @ 07:35 PM