similar to: Eager loading: what am I doing wrong?

Displaying 19 results from an estimated 19 matches similar to: "Eager loading: what am I doing wrong?"

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,
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 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
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 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'',
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 Apr 19
2
I need help in ActiveRecord..
I have this Product.find(:all, :include => [:brand, :category, :type], :group => "description"), but it dont group by description why? Bruno -- Posted via http://www.ruby-forum.com/.
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 Mar 14
3
cascading eager loading patch not working in oracle
Notice the "AS" keyword appears many times. Oracle does not support this keyword: ActiveRecord::StatementInvalid: OCIError: ORA-00905: missing keyword: SELECT tim esheets.id AS t0_r0, timesheets.start_date AS t0_r1, timesheets.status AS t0_r2, timesheets.cost AS t0_r3, timesheets.charge AS t0_r4, timesheets.employee AS t0 _r5, employees.id AS t1_r0, employees.name AS t1_r1,
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`
2008 Feb 09
0
MVC interplay to query multiple models
I''m trying to track down why I''m getting close to desired output, but not quite. It looks like the webpage sorta-kinda is grabbing the right data. For instance, there are three Login objects which should be showing and it looks like the show is grabbing three objects, so that fits, to a degree. However, it''s just grabbing the hexadecimal object id, and not
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/.
2007 Feb 22
1
using ActiveRecord with flat files
For the application I''m working on I would like to not save the uploaded files in the database as I have done previously. It seems more "natural" to simply store them in a directory. Now I''m thinking that it would be nice to be able to take advantage of ActiveRecord anyway - override a couple of methods, so that I can define the associations in the customary way and
2009 Mar 10
5
'unknow column error' when using include and associated table condition in find
Here is my weird problem. Two models like following: Lexeme id:int name:string Structure id:int ref_id:string meta_id:int Lexeme can have many structure records through foreign key ''ref_id'' in the structures table. And these structure records belonging to one lexeme differs between each other using meta_id. And if Lexeme has structures, then there must be a top_struct whose
2009 Feb 22
2
Mysql error unknown column 'columns.user_id'
Had this error when trying to add comments to another user''s photo. ActiveRecord::StatementInvalid in User photosController#show Mysql::Error: Unknown column ''comments.user_id'' in ''on clause'': SELECT photos.`id` AS t0_r0, photos.`user_id` AS t0_r1, photos.`title` AS t0_r2, photos.`body` AS t0_r3, photos.`created_at` AS t0.... I did create a user_id
2002 Dec 13
2
how to get Residual Standard Error
Hi, I use lm or loess to make smoothing. After smoothing I need "Residual Standard Error" in my script. Could you please tell me how can I get this information? Thanks,
2006 Jul 04
13
NewBie question
Hi, I m very new to Ruby. I bought a book "Ruby on Rails" and I think I understand some concepts. My question is : Is there a way to not use "Cookies" or "Sessions Variables" to keep some information about the user. I ask this question because I would like to prevent some cases where the user browser won''t accept cookies. I m from Asp 3.0, and I
2010 Jul 08
25
Prepared SQL statements
Dear all great developers. I wonder if there is any work being done or thoughts being shared regarding prepared SQL statements. Currently I am in heavy need of tuning SQL INSERTS that insert large (3MB) images into blobs. I am using rails 2.3.5 with postgres adapter and pg driver. Any information would be appreciated. Jarl -- You received this message because you are subscribed to the
2010 May 17
0
Sharing same storage on two diffrent KVM hosts
Hello , I whould like your suggestion regarding the following problem : I got 2 host which are running under RHEL5.4 hypervizor . both of the hosts disks is a logical volume .( Each for each ) under the same VG . I want to add storage ( another logical volume ) which will be availble for both of the host as local disk . ( Share storage ) Thanks . -------------- next part -------------- An