From kevin at mopacmedia.com Fri May 2 13:15:43 2008 From: kevin at mopacmedia.com (Kevin Triplett) Date: Fri, 02 May 2008 12:15:43 -0500 Subject: [Betternestedset-talk] Need help Message-ID: <481B4C3F.4060605@mopacmedia.com> I've been using BNS on my project pretty extensively, it's a great plugin, thanks JCM, et al! From the maillist archive, it appears there are forks and later versions that I can find on Trac? (The only version there is 2 years old.) Sorry for what seems like a dumb question to me, but where are the latest versions lurking? I have SVN installed, so a link to the latest version would be lovely. Thanks! :) Kevin Triplett From kevin at mopacmedia.com Fri May 2 13:35:09 2008 From: kevin at mopacmedia.com (Kevin Triplett) Date: Fri, 02 May 2008 12:35:09 -0500 Subject: [Betternestedset-talk] Need help In-Reply-To: <481B4C3F.4060605@mopacmedia.com> References: <481B4C3F.4060605@mopacmedia.com> Message-ID: <481B50CD.3080008@mopacmedia.com> > are the latest versions lurking? I have SVN installed, so a link to the > latest version would be lovely. Thanks! :) Or maybe on github? :D From jc.michel at symetrie.com Sun May 4 05:45:31 2008 From: jc.michel at symetrie.com (Jean-Christophe Michel) Date: Sun, 4 May 2008 11:45:31 +0200 Subject: [Betternestedset-talk] Need help In-Reply-To: <481B4C3F.4060605@mopacmedia.com> References: <481B4C3F.4060605@mopacmedia.com> Message-ID: Hi Kevin, Le 2 mai 08 ? 19:15, Kevin Triplett a ?crit : > I've been using BNS on my project pretty extensively, it's a great > plugin, thanks JCM, et al! Thanks ! > From the maillist archive, it appears there are forks and later > versions that I can find on Trac? (The only version there is 2 > years old.) No, see svn for versions, trac misses some updates... See for instance Krishna enhancements in http://betternestedset.rubyforge.org/svn/branches/ez-set/lib/ Jean-Christophe Michel -- symetrie.com Better Nested Set for rails: http://opensource.symetrie.com/trac/better_nested_set From mabed at starpower.net Wed May 7 15:21:47 2008 From: mabed at starpower.net (Mohammad Abed) Date: Wed, 7 May 2008 15:21:47 -0400 Subject: [Betternestedset-talk] multiple trees without a root Message-ID: Hi, What would be a better design for this tree. I have Categories of bicycles, there are a lot more categories than sown. Should I create a root category as in the Readme file like this. I'll be using these trees for dependent drop-downs, menus, etc... Bicycle_Categories | |_ Road |_ Steel |_ Titanium |_ Carbon Fiber |_ Mountain |_ Steel |_ Aluminum |_ Scandium Or just create independent trees without a main root. |_ Road |_ Steel |_ Titanium |_ Carbon Fiber |_ Mountain |_ Steel |_ Aluminum |_ Scandium -------------- next part -------------- An HTML attachment was scrubbed... URL: From cnk at caltech.edu Wed May 7 16:04:08 2008 From: cnk at caltech.edu (Cynthia Kiser) Date: Wed, 7 May 2008 13:04:08 -0700 Subject: [Betternestedset-talk] multiple trees without a root In-Reply-To: References: Message-ID: <20080507200407.GG9947@inky.caltech.edu> It always depends. If you NEVER want to show all choices, then independent trees is probably OK. But I would probably have a single tree - and then a helper method that lets me get all the first level children easily. And you may want another helper that would give the 'root' of the subtree, something like 'bike_class' that would return Road, Mountain, etc. Quoting Mohammad Abed : > Hi, > > What would be a better design for this tree. I have Categories of bicycles, > there are a lot more categories than sown. Should I create a root category > as in the Readme file like this. I'll be using these trees for dependent > drop-downs, menus, etc... > > Bicycle_Categories > | > |_ Road > |_ Steel > |_ Titanium > |_ Carbon Fiber > |_ Mountain > |_ Steel > |_ Aluminum > |_ Scandium > > > Or just create independent trees without a main root. > > |_ Road > |_ Steel > |_ Titanium > |_ Carbon Fiber > |_ Mountain > |_ Steel > |_ Aluminum > |_ Scandium From jharbslists at gmail.com Fri May 23 19:16:47 2008 From: jharbslists at gmail.com (Jerad Harbaugh) Date: Fri, 23 May 2008 17:16:47 -0600 Subject: [Betternestedset-talk] xml result filtering Message-ID: in followup to my last email regarding how to use result_to_xml, i was able to do so, with this syntax: <%=Match.result_to_xml match.full_set%> Now, i am wondering how to filter out some of the nodes within my xml. I only need the id of the match object, not the updated-at and created-at values that match model includes. I don't want this: 2008-05-23T16:33:46-06:00 369 2008-05-23T16:33:46-06:00 I want this: 369 Does this makes sense? i want to trim down my xml result object so that the object is light weight to go across the wire. thanks, jerad -------------- next part -------------- An HTML attachment was scrubbed... URL: From tarscher at gmail.com Wed May 28 04:11:40 2008 From: tarscher at gmail.com (=?ISO-8859-1?Q?Gecke_R=FCn?=) Date: Wed, 28 May 2008 10:11:40 +0200 Subject: [Betternestedset-talk] error inserting node in tree Message-ID: Hi all, I 'm trying to add a node to a tree (tabel has multiple trees). @node.save @node.move_to_child_of(1) # 1 is the id of the parent node When trying to add the node I get an error: SQL (0.000000) BEGIN BEGIN SQL (0.000000) Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? ? "root_id IS NULL" : "root_id = #{root_id}")' at line 1: SELECT max(rgt) AS max_rgt FROM `nodes` WHERE (root_id.nil? ? "root_id IS NULL" : "root_id = #{root_id}") SQL (0.000000) ROLLBACK Since I have multiple trees I defined a scope in my node model: class Node < ActiveRecord::Base acts_as_nested_set :scope => :club_id has_one :club ... class Club < ActiveRecord::Base belongs_to :node ... When I remove this scope I don't get the error. additional info: Node table id-int(11) club_id-int(11) parent_id-int(11) lft-int(11) rgt-int(11) name-varchar(100) Someone knows what I'm doing wrong? Regards, Stijn From cnk at caltech.edu Wed May 28 12:27:17 2008 From: cnk at caltech.edu (Cynthia Kiser) Date: Wed, 28 May 2008 09:27:17 -0700 Subject: [Betternestedset-talk] error inserting node in tree In-Reply-To: References: Message-ID: <20080528162717.GB18218@blinky.caltech.edu> Quoting Gecke R?n : > SQL (0.000000) Mysql::Error: You have an error in your SQL syntax; > check the manual that corresponds to your MySQL server version for the > right syntax to use near '? ? "root_id IS NULL" : "root_id = > #{root_id}")' at line 1: SELECT max(rgt) AS max_rgt FROM `nodes` WHERE > (root_id.nil? ? "root_id IS NULL" : "root_id = #{root_id}") ... > Someone knows what I'm doing wrong? Somehow you are getting uninterpreted ruby code in your SQL. I don't see anything in the code fragments you sent that is setting these conditions (and then not interpreting them). I would poke around in the call stack looking for files in your code - or in the betternestedset plugin to try to find the code fragment above. Then try to see why it is slapping straight ruby into the SQL query. -- Cynthia Kiser From tarscher at gmail.com Wed May 28 12:59:17 2008 From: tarscher at gmail.com (=?ISO-8859-1?Q?Gecke_R=FCn?=) Date: Wed, 28 May 2008 18:59:17 +0200 Subject: [Betternestedset-talk] error inserting node in tree In-Reply-To: <20080528162717.GB18218@blinky.caltech.edu> References: <20080528162717.GB18218@blinky.caltech.edu> Message-ID: I found a simular problem and using up to date code fixed the issue. Regards, Stijn On Wed, May 28, 2008 at 6:27 PM, Cynthia Kiser wrote: > Quoting Gecke R?n : >> SQL (0.000000) Mysql::Error: You have an error in your SQL syntax; >> check the manual that corresponds to your MySQL server version for the >> right syntax to use near '? ? "root_id IS NULL" : "root_id = >> #{root_id}")' at line 1: SELECT max(rgt) AS max_rgt FROM `nodes` WHERE >> (root_id.nil? ? "root_id IS NULL" : "root_id = #{root_id}") > > ... > >> Someone knows what I'm doing wrong? > > Somehow you are getting uninterpreted ruby code in your SQL. I don't > see anything in the code fragments you sent that is setting these > conditions (and then not interpreting them). I would poke around in > the call stack looking for files in your code - or in the > betternestedset plugin to try to find the code fragment above. Then > try to see why it is slapping straight ruby into the SQL query. > > -- > Cynthia Kiser > > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk >