-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Article about closure_tree #102
Comments
README is not a place for such things. btw you should rename your indexes and correct your comments add_index :comment_hierarchies, [:ancestor_id, :descendant_id, :generations],
:unique => true, :name => "tag_anc_desc_udx" #<< you have comments not tags |
Cool, thanks! |
I just read your article—it was very straightforward and ready to follow, I'll add a link to your article. I think it might help others use this gem. |
@bodrovis the biggest issue with ancestry isn't the project activity—it's that he's using a "materialized path". He's using a concatenated set of IDs in a string for tree management. This approach is fine when you only have several hundred records, and your query can do table scans. It breaks down at higher scale, though. The other approach is using a "nested set"—but that requires every tree update to touch half of the other rows in your tree table (worst case). I think it might be interesting to add a benchmark in your article contrasting the performance of the three approaches. |
@mceachen Oh, okay, I will try do some research :) |
@bodrovis : https://github.com/mceachen/closure_tree/wiki look at the last link. |
@bodrovis I added the link in the FAQ section. Thanks again for writing that tutorial! |
The pleasure was all mine :) |
Hello!
Recently I've written an article for Sitepoint http://www.sitepoint.com/nested-comments-rails/ about closure_tree gem and, specifically, how to create nested comments system with it. You might want to give a link to it somewhere in the Readme. And thanks for this cool gem :)
The text was updated successfully, but these errors were encountered: