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.

Changeset [a5dda97602f2188a13cbcab5c7e9a5ba84ba876b] by José Valim

Revision a5dda97602f2188a13cbcab5c7e9a5ba84ba876b, committed by José Valim · July 5th, 2010 @ 12:01 PM

Define a convention for descendants and subclasses.

The former should be symmetric with ancestors and include all children. However, it should not include self since ancestors + descendants should not have duplicated. The latter is symmetric to superclass in the sense it only includes direct children.

By adopting a convention, we expect to have less conflict with other frameworks, as Datamapper. For this moment, to ensure ActiveModel::Validations can be used with Datamapper, we should always call ActiveSupport::DescendantsTracker.descendants(self) internally instead of self.descendants avoiding conflicts.
http://github.com/rails/rails/commit/a5dda97602f2188a13cbcab5c7e9a5...

13 changed files

  • R activesupport/lib/active_support/core_ext/object/extending.rb
  • M actionpack/lib/action_controller/base.rb
  • M actionpack/lib/action_controller/railtie.rb
  • M actionpack/lib/action_dispatch/routing/deprecated_mapper.rb
  • M activerecord/lib/active_record/observer.rb
  • M activesupport/lib/active_support/callbacks.rb
  • M activesupport/lib/active_support/core_ext/class/subclasses.rb
  • M activesupport/lib/active_support/core_ext/object.rb
  • M activesupport/lib/active_support/descendants_tracker.rb
  • M activesupport/test/core_ext/class_test.rb
  • M activesupport/test/core_ext/object_and_class_ext_test.rb
  • M activesupport/test/descendants_tracker_test.rb
  • M railties/guides/source/active_support_core_extensions.textile