similar to: To convert an adjacency list model into a nested set model

Displaying 20 results from an estimated 1000 matches similar to: "To convert an adjacency list model into a nested set model"

2005 Oct 12
2
Help with act_as_nested_set
Hi, I''m trying to get act_as_nested_set working, and I''m puzzled. I googled the following http://codefetch.com/cache?url=http://media.pragprog.com/titles/rails/code/r ails-code.tgz <http://codefetch.com/cache?url=http://media.pragprog.com/titles/rails/code/ rails-code.tgz&path=rails-code/ar/acts_as_nested_set.rb&lang=ruby&qy=ruby>
2006 Mar 15
5
acts_as_threaded - help ???
Hi, has anyone successfully used the acts_as_threaded plugin with postgresql? I''m using rails 1.0 and ruby 1.8.4 on linux. Following the screencast on http://www.railtie.net/articles/2006/02/05/rails-acts_as_threaded-plugin , I got to where we''re ready to create our first post, having made the changes to controllers/posts_controller.rb, views/posts/_form.rhtml,
2006 May 10
1
acts_as_nested_set does not work (in my case).
Hello, I am using acts_as_nested_set. My problem is that the columns "lft" and "rgt" get the value 0 if I create a new entity. If I delete an entity I get negative values (-1, -2, -3) - but for all entities. Is there anything missing? Is there any example for "acts_as_nested_set" in the web? -- Posted via http://www.ruby-forum.com/.
2007 Jan 31
2
has_many :conditions
Is it possible to put conditions relative to the current instance in has_many''s :conditions? For example, in a forum app: class Post < ActiveRecord::Base belongs_to :topic has_many :self_and_descendants, :class_name => "Post", :order => "lft", :conditions => "topic_id = #{topic_id} AND (lft BETWEEN #{lft} AND #{rgt})" end With the
2010 Aug 01
0
Picking Part of Large R Object
Dear All, I have imported an HTML document to R (called tables) and wish to select certain pieces of it for processing. The first few lines of the object appear as follows: > tables [[1]] <table id="fs-table" class="gf-table rgt"> <thead> <tr><th class="lm lft nwp"> In Millions of USD (except for per share items) </th> <th
2006 Jul 18
1
Bad values for acts_as_nested_set?
I moved from acts_as_tree to acts_as_nested_set because I need the all_children method. I''ve seen an alternative way to add this method to acts_as_tree here: http://www.chuckvose.com/articles/2006/05/24/recursive-children But I''d prefer to use the more efficient way of acts_as_nested_set (and not to have to revert to my old code). Anyway, here''s my issue: if I
2009 Aug 19
10
acts_as_list / acts_as_tree / acts_as_nested_set - which one
I am creating forum application which needs usage of acts_as_list or acts_as_tree or acts_as_nested_set. I am unable to decide among these. please could some one recommend from their experience? -- Posted via http://www.ruby-forum.com/.
2006 May 12
2
Has many through join table issues
I''m trying to wrap my caffeine soaked brain around has_many :through following along at: http://rails.techno-weenie.net/tip/2005/12/23/teaching_your_blog_model_new_tricks_with_has_many_through I think my models are a little more complex than what fits this narrative. I have a directory of members, each member can belong to multiple categories. The category table references itself
2006 Jun 20
2
Converting from acts_as_tree to acts_as_nested_set
I''m currently using acts_as_tree to display threaded Comments on my forums-like site. It''s waaay too slow to display a page with 1,000 comments, as it''s issuing a TON of selects. I''m pretty sure I want to convert to the nested set model, using acts_as_nested_set or acts_as_threaded. This should give me the performance I''m looking for. The problem,
2009 Feb 17
8
Converting Acts_As_Tree to Acts_As_Nested_Set
Hello, I have a tree structure that needs to be converted into a nested set. A great deal of work has already been done on the tree items, so maintaining the integrity of the id''s is mandatory. However I need the ability to access entire branches of the tree, which is what Nested set does. Does anyone have any suggestions on how to efficiently transfer the tree to the nested set and
2006 May 31
1
Help enhancing acts_as_nested_set
I''m trying to enhance acts_as_nested_set. Well actually I already have, but I''ve done a hack up job of it. I would like to contribute these enhancements back, but I need a little help. I''m a complete newbie to this stuff. The only thing I new before coming into this project was vanilla HTML. So over the course of two weeks I''ve picked up Ruby, Rails, MySQL,
2006 Jun 02
2
Sticky Options to Find?
Is there a way to provide "sticky" options to ActiveRecord::Base::Find ? I''m thinking something with a use model like: class Function < ActiveRecord::Base sticky :conditions => "lft > 0", :order => "lft ASC" end Where all subsuquent find operations have those options applied. In this case: Function.find(:all) Would actually be equivalent
2003 Jan 23
2
send_files failed to open filename ...
Hi everybody, I'm mirroring some websites with rsync (daemon on the source), and I noticed in the destination host some error messages 'send_files failed to open filenames', Actually, the concerned files are deleted on the source host, but I would like to ask : * why does rsync say these (in which phase) ? * is these messages harmful or not ? Here below my rsync command and some
2002 Nov 28
1
IP address change
A while back samba was installed on a machine with IP address 10.1.0.19, default router 10.1.0.1. The IP address was recently changed to 10.2.0.57, default router 10.2.0.1. The share used to be available across our network as specified by hosts allow. However, since the IP Address change ONLY 10.2 machines can see the share. It is no longer available to the whole network. The server itself can be
2005 Aug 05
0
Finding by inclusion in nested set
Say I have tasks with a belongs_to association to categories where the later act as a nested set. Now I want to find all tasks belonging to a specific category (given as primary key) or any of its sub-categories. SELECT tasks.*, tasks_category.name FROM categories AS nested_set_categories, tasks LEFT OUTER JOIN categories AS tasks_category ON tasks_category.id = tasks.category_id WHERE
2006 Jan 01
7
[ ANN ] Hieraki2
Happy new year! Hieraki 2.0.0 is released. You can download Hieraki2 from rubyforge.org as tgz or zip (http://rubyforge.org/projects/hieraki). Hieraki2 has a new wiki engine that ships with more than a dozen new features: * everything-is-a-wiki-page (TM) * all pages are under version control * access control list * stay in full control of the tree structure by cut and pasting
2013 Nov 01
1
[PATCH] curve25519-sha256@libssh.org key exchange proposal
Here are three versions (patch against openbsd cvs) 1) repace nacl w/libsodium, so i could test 2) curve25519-donna 3) Matthew's public domain reference implementation. i'd vote for #3 -------------- next part -------------- Am 30.10.2013 um 07:27 schrieb Damien Miller <djm at mindrot.org>: > On Tue, 24 Sep 2013, Aris Adamantiadis wrote: > >> Dear OpenSSH
2008 Mar 23
2
(no subject)
Is there any way to use more than one color or shape in the same plot. I would like to make the points different colors for various levels of a variable. I have tried a simple 'if' statement in the plot command, but I get an error message. Here is what I have tried and the error message I get: > plot(test, if(test[,1]<8) col="steelblue2" else col="wheat2")Error
2006 Mar 15
0
Acts_as_nested performance query
Wondering about using the acts_as_nested for a model but concerned about the performance overhead of having to rewrite the table each time and entry is added or removed(and locking it while it''s happening or risking data integrity probs). Wasn''t really familiar with the structure so did a little reading up on it, and one solution to this seems to spreading the table out, so
2011 Nov 23
0
Awesome nested set - how to put there items?
hello guys, I have following structure of the table, where I store items of tree: | id | int(11) | NO | PRI | NULL | auto_increment | | user_id | int(11) | YES | | NULL | | | parent_id | int(11) | YES | | NULL | | | lft | int(11) | YES | | NULL | | | rgt | int(11) | YES