search for: add_child

Displaying 12 results from an estimated 12 matches for "add_child".

2005 Oct 12
2
Help with act_as_nested_set
.../code/ rails-code.tgz&path=rails-code/ar/acts_as_nested_set.rb&lang=ruby&qy=ruby> &path=rails-code/ar/acts_as_nested_set.rb&lang=ruby&qy=ruby Which I''m inserting here: class Category < ActiveRecord::Base acts_as_nested_set end Category.delete_all def add_child(parent, name) child = Category.create(:name => name) parent.add_child(child) || fail("Couldn''t add #{name}") child end root = Category.create(:name => "Books") fiction = add_child(root, "Fiction") non_fiction = add_child(root, "Non...
2006 Oct 21
0
[ wxruby-Bugs-6262 ] MDIParentFrame#add_child not working on OS X
...You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=6262&group_id=35 Category: Incorrect behavior Group: None Status: Open Resolution: None Priority: 3 Submitted By: Alex Fenton (brokentoy) Assigned to: Kevin Smith (qualitycode) Summary: MDIParentFrame#add_child not working on OS X Initial Comment: MDIParentFrame#add_child either crashes (in bigdemo) or does nothing at all (mdi demo), on OS X. There isn''t true MDI on OS X, but wxRuby should follow WxWidgets in providing an emulation of it, using ordinary Frames. ---------------------------------...
2006 Oct 22
1
[Fwd: Wxruby-development post from noreply@rubyforge.org requires approval]
...at rubyforge.org To: wxruby-development-owner at rubyforge.org As list administrator, your authorization is requested for the following mailing list posting: List: Wxruby-development at rubyforge.org From: noreply at rubyforge.org Subject: [ wxruby-Bugs-6262 ] MDIParentFrame#add_child not working on OS X Reason: Message has implicit destination At your convenience, visit: http://rubyforge.org/mailman/admindb/wxruby-development to approve or deny the request. -------------- next part -------------- An embedded message was scrubbed... From: <noreply at rubyforge...
2006 Jan 30
2
can I update many rows with one call to the database?
...SET bar = 19, baz = 47 WHERE id = 2'' (but much longer). But it doesn''t work... it doesn''t like the semicolon. Is there really no way to do this? The problem I''m trying to solve is that sometimes the acts_as_nested_set data needs updating completely, but calling add_child on each item individually makes O(n*n) connections. I can reduce it to O(n) connections, and it went from taking 25 minutes to only 2 minutes... but I really need to get this down to a few seconds. Thanks so much, Katy
2006 Jul 18
1
Bad values for acts_as_nested_set?
...tegory_id", :integer t.column "parent_id", :integer t.column "lft", :integer t.column "rgt", :integer t.column "created_at", :datetime end Some code to reproduce the results: root1 = Element.create(:name => "root1") root1.add_child(Element.create(:name => "root1child") root2 = Element.create(:name => "root2") root2.add_child(Element.create(:name => "root2child") Data view: ID | PARENT_ID | LFT | RGT | NAME 1 | 0 | 1 | 4 | root1 2 | 1 | 2 | 3 | root1ch...
2006 May 05
0
JavaScript Prompt and link_to_remote
Hi all, I would like to get one of the parameters for a link_to_remote with JavaScript prompt. So far I have this: link_to_remote(image_tag("/images/interface/add.png"), :before => "$name = prompt(''Name?'')", :url => { :action => ''add_child'', :id => node, :name => XXX }, :update => "node_list_#{node.id}", :position => ''top'', :complete => visual_effect(:highlight, "node_list_#{node.id}") ) I get prompted for the name. How do I add it to the parameter list, i.e...
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 13
0
better nested set 0.1
...orthwhile trade for most web applications. Migrating from an ordinary adjacency list tree (such as acts_as_tree) is not complex, particularly if your table contains only a single tree. NOTE: This 0.1 release will be the only one fully backwards-compatible with the original acts_as_nested_set. The add_child method will be dropped in the future, and the possibility of having a root defined by parent_id == 0 will be removed. Milestones: 0.2 will add ... A promising branch is being built by Krishna Dole to provide an even simpler API, closer to that of acts_as_tree. Grab it from svn://rubyforge.org/var/...
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,
2018 Nov 13
0
Error running "samba-tool dbcheck" after going from 4.8.6 to 4.9.2
...n), str(to_base)))                      parent_dn = deleted_objects_dn              if parent_dn is None:                  parent_dn = obj.dn.parent() -            expected_dn = ldb.Dn(self.samdb, "RDN=RDN,%s" % (parent_dn)) +            expected_dn = parent_dn +            if expected_dn.add_child("RDN=RDN") == False: +                raise CommandError("Failed to add RDN to %s" % expected_dn)              expected_dn.set_component(0, obj.dn.get_rdn_name(), name_val)                if obj.dn == deleted_objects_dn: (However it might also blow up in our face due to ldb_dn_...
2018 Nov 08
3
Error running "samba-tool dbcheck" after going from 4.8.6 to 4.9.2
I just tested Samba 4.9.2 on one of my DCs, previously running version 4.8.6. Immediately after install, I ran "samba-tool dbcheck" and got the following: Checking 511 objects ERROR(<type 'exceptions.UnicodeDecodeError'>): uncaught exception - 'ascii' codec can't decode byte 0xc3 in position 25: ordinal not in range(128)   File
2006 May 31
1
Help enhancing acts_as_nested_set
...# Adds a child to this object in the tree. If this object hasn''t been initialized, # it gets set up as a root node. Otherwise, this method will update all of the # other elements in the tree and shift them to the right, keeping everything # balanced. def add_child( child ) self.reload child.reload if self.unknown? ## Make self a root node if it, too is unknown self.class.add_root self end if child.unknown? # OK, add as the last child into self # we need to add and shi...