identifying root #12

Closed
boazrymland opened this Issue Sep 23, 2012 · 2 comments

Projects

None yet

2 participants

@boazrymland

Hi,

I'm designing and implementing a comment module and I intend to make a good use of this good extension in order to handle the "tree-ness" aspect of comments.

Now, I have several tables that relate to other 'comments' aspects (rating, popularity marks, etc) but the main table is... yep, "comments". In this table I have assimilated the tables defined in this extension's 'schema' directory (for multiple roots, of course).

I have two issues in this issue:

  1. First, just to make sure, in order to find all 'root comments' of a specific content I use the roots() named scope method and add my own condition to the 'findAll()' call?
  2. Next, 'root' column is a reference, a-la foreign key, but to the same table (to column 'id'), that connects a node directly to its root, right? If so, then I think that the documentation is slightly outdated - the readme.md mentions 'root_id' instead of 'root'. If you want, I can easily issue you a pull request with a fix on this file. If this suits you, just let me know if to push the fix on the fork I already did (it was merged so I thought its supposed to be closed but it looks operative) or create a new one and push that one.

Thanks.

@creocoder
Member

First, just to make sure, in order to find all 'root comments' of a specific content I use the roots() named scope method and add my own condition to the 'findAll()' call?

Yes

Next, 'root' column is a reference, a-la foreign key, but to the same table (to column 'id'), that connects a node directly to its root, right?

Yes

Can you make PR to fix doc?

@boazrymland

Thanks for the answers.
Yes, I'll make a PR with a fix soon.

@boazrymland boazrymland referenced this issue Sep 23, 2012
Merged

fixed #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment