Provides tree behavior to active_record models.