similar to: acts_as_tree and :include

Displaying 20 results from an estimated 200 matches similar to: "acts_as_tree and :include"

2006 Apr 10
1
random | in join statement with more than one :include
I have an ActiveRecord class that has several has_many,belongs_to, habtm, and the new has_many => :through relationships. Whenever I try a find(:all, :conditions => "some conds", :include [:relationship]) it works fine, but if I have find(:all, :conditions => "some conds", :include [:relationship, :other_relation]) it gets a sql error such as Mysql::Error: You
2006 Jan 09
3
Include with two references of one model of the same table
Hey guys, I just came across this oddity, not sure what to make of it yet, but I think it might be incorrect behavior. When doing a @inst.find(:all, :include => ["hometeam", "awayteam"] ...) hometeam and awayteam are two references from a belongs_to that is of the same model and of the same table. I will get a pgerror stating that "matches", which is
2006 Jun 25
2
how to write the codes in view?(newbie question)
Hi. I have two tables and want to join them. <genres> id genre_name genre_order <links> id genre_id name symbol url order display etc The code of links_Controller is like below. def list @links = Genre.find(:all,:include => :link) end Below is the mysql log. SELECT genres.`id` AS t0_r0, genres.`genre_n ame` AS t0_r1, genres.`genre_order` AS t0_r2, links.`id` AS t1_r0,
2007 May 22
2
find :all :include broken on Oracle 10
Hi, I am trying the following in Ruby using InstantRails 1.7 on WindowsXP Publication.find(:all, :include => [:doc_type, :release_state] ) but I get the error: OCIError: ORA-00904: "DOC_TYPES"."PUBLICATION_ID": invalid identifier: SELECT publications.id AS t0_r0, publications.docid AS t0_r1, publications.doc_type_id AS t0_r2, publications.title AS t0_r3,
2013 Oct 08
4
'puppet storeconfigs export' killed
Hi, I currently have a MySQL database containing all Puppet storeconfigs. My intention is to migrate to PuppetDB on a PostgreSQL server, so the first step is to use the ''storeconfigs'' face to export all the DB to a file PuppetDB can later consume. But the ''puppet storeconfigs export'' command always ends up being killed, I suspect due to some sort of OOM
2006 Nov 28
0
Eager loading: what am I doing wrong?
I am trying to get eager loading to work. So far it does have an effect on the initial query issued - though not the desired on: it just mentions all the fields explicitly, but creates no joins: [4;36;1mCourse Load Including Associations (0.002771) [0m [0;1mSELECT courses.`id` AS t0_r0, courses.`name` AS t0_r1, courses.`reference` AS t0_r2, courses.`subject_id` AS t0_r3, courses.`course_type_id`
2005 Apr 27
5
Eager load mysteriously deletes records
Hi This looks like a bug in ActiveRecord. I am messing with eager loading (on 12.1) and all of a sudden records started disappearing from a table (and I am not doing anything delete related)!! The following line works OK:- @todos = Todo.find(:all, :include => [ :whens],:order => "position ASC") The following line is mysteriously deleteing :where rows from the DB after
2006 May 23
5
AR Caching and Reflection
When I do this: term = Term.find(1, :include => :definition) term.definition.term Two SQL queries are fired, why? -- Posted via http://www.ruby-forum.com/.
2006 May 18
1
Feed 2 tables with one Form
hi all, i have a form with several datas given by the user : name, adress , tel etc... When the user press "create" i call an action called "create_stagiaire" which create his account but i also want to feed another table named "demandes" where which i feed with a date given by the user. In my form this date field is writen like this : <%= date_select
2006 Feb 19
2
Another "escaping" problem
Ruby 1.8.2, edge Rails (and 1.0), Mac OS X 10.4.3. Here''s the SQL that gets generated for an eager load: SELECT events.`id` AS t1_r0, events.`user_id` AS t1_r1, addresses.`id` AS t0_r0, events.`name` AS t1_r2, addresses.`name` AS t0_r1, events.`meet_at` AS t1_r3, addresses.`phone_number` AS t0_r2, events.`created_at` AS t1_r4, addresses.`phone_service` AS t0_r3, events.`location_id`
2006 May 20
3
In a find, can''t you use both :include and :limit ?
I''m trying to do a find that includes a join. It has to be a find because I''m using the results for a Pagination, so I need to limit my query to the number of results I want to display per page. Here''s the type of thing I want to do: Employee table <-> Skills_Employees table <-> Skills table Let''s say I want to find all the employees who have
2006 Mar 21
8
Loading the contents of a CSV file to a database
Hello Everybody, I picked up on the buzz about RoR and wanted to see what the fuss is about. So far i am very impressed but have hit a bit of a wall with a little play app i am writting. I want to iterate through a CSV file of my bank transactions and see just how much money i spend on beer and pies every month. I have successfully setup a database with a single table called transactions
2006 Aug 12
0
Permission denied [solved]
many thanks Michael 2006/8/10, Michael Siebert <info@siebert-wd.de>: > > chmod -r a+rwx tmp > should work > > > 2006/8/10, Roberto Felloni <roberto.felloni@gmail.com>: > > > Hi to all. > I''m a newbye, and this is my first contact with list. > > I have installed ruby and rails. > My ruby local home page works, but development.log tell me
2006 Jun 13
3
acts_as_tree problem accessing parent object
i have a model called certification_types that i''ve declared as acts_as_tree. I have a model called certification that belongs_to :certification_type . class CertificationController < ApplicationController ..... def summary_list @certifications = Certification.find(:all, :order=>''date'') end end summary_list.rhtml <% for certification in
2006 Jun 14
0
problems with acts_as_tree
I have a class called Organization that is organized as a tree (organizations have parent organizations) using a parent_id column and an organizations_count column. I used the generate scaffold method to create the controller and views. But when I go to add or update an Organization, there is no select box to select the parent Organization. I am surprised that the scaffold generator
2006 Jun 19
0
Eager loading and acts_as_tree
Hi all, I have a node structure which acts_as_tree. I am pulling the first two levels under the root node with: @root = Node.find(1, :include => [ { :children => [ :children, :parent ] }, :parent ]) How do I pull out the first three levels? What about four? @root = Node.find(1, :include => [ { :children => [ { :children => [:children, :parent] }, :parent ] }, :parent ])
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 May 24
0
Bump: filtering results in acts_as_tree
---------- Forwarded message ---------- From: Larry White <ljw1001@gmail.com> Date: May 23, 2006 10:35 AM Subject: filtering results in acts_as_tree To: rails@lists.rubyonrails.org 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
2006 May 30
2
acts_as_tree, acts_as_list and is invincible (help!)
So I have the following model class Topic < ActiveRecord::Base belongs_to :topic has_many :topics, :order => :position acts_as_tree :order => :position acts_as_list :scope => :topic_id end that I use for a site''s navigation. Everything (list, create, edit, even the drag&drop sort) works fine, except the destroy function, which the vanilla version def destroy
2006 Apr 08
1
control for acts_as_tree structure
Hi, I am looking for a good javascript control to display an acts_as_tree structure. Has anyone had good luck with an existing one or would it be better to roll my own? Thanks, Dan