similar to: Bump: filtering results in acts_as_tree

Displaying 20 results from an estimated 20000 matches similar to: "Bump: filtering results in acts_as_tree"

2006 May 23
0
filtering results in acts_as_tree
I''m using a logical delete for a table and want to use acts_as_tree with it. Is there any way to filter the rows returned as the tree is traversed to include only those records where the deleted column is equal to FALSE? thanks very much for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Apr 28
2
Active Record save doesn''t save! (more detail - is this a bug?)
I got it to work by changing scheduled_end_date= nil to self.scheduled_end_date= nil. I believe these statements should be equivilent. I don''t know Ruby/Rails well enough to know when, if or why that should matter. Can someone educate me please? I want to believe this framework is ready for production work, but silently dropping data is a very big problem. I expect that I''ve
2006 Jun 17
2
URL based on acts_as_tree using routes
Hi There! I''d like some feedback before I try to implement some funky rails routes based on an acts_as_tree model. I have a Page model that acts_as_tree. I''d like the URLs to look something like this: http://localhost/about-us/staff/jeff or, another example... http://localhost/what-we-do/products/our-great-cms/features/faqs/ So, as many sub-nodes the user creates,
2007 Feb 14
3
eager loading parents and children (acts_as_tree)
I am struggling with how to do eager loading of an acts_as_tree model. If the model Stuff acts_as_tree I know I can do this to get children as well: Stuff.find(:all, :include => :children) But what if the model I am including is the one that acts_as_tree? For example, say Picture belongs_to Category. Category acts_as_tree and I want to get all pictures that are members of a category that
2006 Jan 19
0
Problem with an Tree-like object hierarchy (ActiveRecord acts_as_tree)
Hello people on rails, I am developing a web interface for a database that has hierarchical data. I want the user to be able to browse the tree (~1300 nodes) and activate/deactivate and showing/hiding groups of nodes (like selecting one node selects all the children and the leafs). So I have a tree of objects (ActiveRecord acts_as_tree). Because I need the tree to be persistent and I
2005 Dec 27
0
acts_as_tree, polymorphism and class loading problems
I have a tree (acts_as_tree) with nodes where each node is instances of different subclasses of Node. Each Node subclass knows how to point to another table/instance in order to accomplish extension by composition. This works good most of the time where I either loops over just the nodes without accessing the "external" data (the instance pointed to by Node subclass) or just
2006 Apr 12
2
Why doesn''t acts_as_tree support :scope?
I want to implement a unique category tree per user in my system, and I was hoping to use "acts_as_tree" on my category model. It seems as if acts_as_tree makes the assumption that the entire table the model is off of is one large tree. I actually want each user to have their own category trees all stored in the category table so I need it to scope off of the user_id.
2006 Jan 16
2
acts_as_tree with Modified Preorder Traversal?
Has anyone extended Rails''s acts_as_tree to use the Modified Preorder Traversal algorithm? This is a really clever trick for optimizing access to trees stored in databases, as described lucidly in this article: http://www.sitepoint.com/article/hierarchical-data-database/2 It adds two integer fields, a "left counter" and "right counter", to each row. By
2006 Feb 08
1
Many-To-Many w/acts_as_tree?
Guys, I''m having a problem getting acts_as_tree working. It seems from the Agile book (p. 255) that acts_as_tree only supports one-to-one record relations, whereas I need many-to-many support. In other words, looking at the picture at the top of page 256 where where only 1 id is linked to 1 parent_id, I need multiple id''s linked to multiple parent_id''s - for
2008 Apr 12
1
acts_as_tree undefined method?
i have acts_as_tree installed as plugin under rails 2.0.2 and also its defined in class TreeItems, but when i put this in my view <ul class="tree_level1" id="cars">Furniture <% TreeItem.root.category.children do |cat_children| %> <li><a class="list_item" href="#"><%=h cat_children.name %></a></ li> <%
2007 Jan 25
1
acts_as_tree with acts_as_list
Hello all, I''m having trouble using acts_as_list with acts_as_tree to order the "children". I''ve found a few old posts on the web that seem to indicate that this once worked. class Whatever < ActiveRecord::Base acts_as_tree :order => :position acts_as_list :scope => :parent_id Although the ''position'' field is being populated, it appears
2006 Jul 20
3
acts_as_tree
Hello, I''m trying to create categories that have their own subcategories, and each subcategory may have its own subcategories, .. and so on. After some reading, I found out that the best way for creating such a thing is to use acts_as_tree, but I didn''t find any tutorial or article that explain this in a clear way. After a lot of work I was finally able to create categories and
2007 Apr 30
2
acts_as_tree
Hi folks, For my app, I needed to modify acts_as_tree (ActiveRecord::Acts::Tree) such that deleting a node would orphan sub-nodes, rather than deleting them. This is accomplished simply by allowing a :dependent option to the acts_as_tree method so that it can be set to :nullify. For my app, I simply did this by adding a file tree.rb to my lib directory and requiring it in the model. A number
2009 Feb 09
1
acts_as_tree
i''m using the command script/plugin install acts_as_tree but i''m still having Plugin not found: ["acts_as_tree"] any helps!!! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email
2006 Jun 08
2
counter_cache is not looking for children_count with acts_as_tree
Hi there, the acts_as_tree API says that I can set a counter cache and that it will automatically increment the "children_count" column. I did that but when I create a new page it asks for a "pages_count" column instead. Here is the relevant part of page.rb model: class Page < ActiveRecord::Base acts_as_tree :order => :position, :counter_cache => true
2006 Jul 17
1
acts_as_tree and :include
hello there, i have a model that uses acts_as_tree: >class GbEntry < ActiveRecord::Base > acts_as_tree :order => ''created_at DESC'' >end and i want it to paginate, including all children to avoid unnecessary db queries: > @gb_entry_pages, @gb_entries = > paginate :gb_entries, :per_page => 15, :order => ''created_at DESC'',
2006 Mar 08
0
acts_as_tree circular reference
my application is using acts_as_tree to create a directed graph. Everyone would work fine, except that nothing prevents the user to create a circular reference: >> item.parent=child >> item.save => true >> child.parent=item >> child.save => true I checked in the database, and there it is: an item that has as parent its own child! item.parent_id = child_id I
2006 Dec 23
0
:through => 'this', :that => acts_as_tree?!
Hi guys. was wondering, how would i access the various parents/nodes in an acts as tree, if that model is from a join model using :through? wa huh? ok.. Say my join class model is called "Crap" and there are two columns with foreign keys: spam_id and more_spam_id. Say the Spam class is an acts_as_tree.. I would hope we would be able to access it like we would a habtm: foo
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,
2006 Nov 04
1
acts_as_tree repeats
Hello Railslist, I want to draw a simple single-table Acts_as_tree model. I''ve read some articles about it and read the API docs, and now I''ve got this running: in controller I have: --- def index @pages = Page.find(:all) end --- in the model for Page I have ofcourse: --- acts_as_tree :order => "position" --- in the helper I have; --- def