Ticket #36 (new defect)

Opened 1 year ago

[PATCH] Fix root instance method

Reported by: rails Assigned to: jcm
Priority: major Milestone:
Component: plugin Version:
Keywords: Cc: brian@collectiveidea.com daniel@collectividea.com

Description

Two fixes talking about root() and roots() instance methods.

1.) The root instance method doessn't work as expected. Instead of finding the current node's root ancestor, it finds the first for the class. This seems very wrong.

With this patch, it finds its root ancestor. I've slightly refactored ancestors() to reduce duplication.

2.) The roots instance method should not exist. Since a node cannot have more than one root node (though a Model certainly could), the roots method is nothing more than a confusing helper for calling Model.roots.

This patch in no way touchs the class methods. Those are great.

Attachments

fix_root_method.diff (2.1 kB) - added by rails on 10/10/07 23:17:56.

Change History

10/10/07 23:17:56 changed by rails

  • attachment fix_root_method.diff added.