similar to: Eager load associations in Oracle problem with more than 1000 records

Displaying 20 results from an estimated 3000 matches similar to: "Eager load associations in Oracle problem with more than 1000 records"

2007 Jun 11
2
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by default? I know I can use tag!, but I''d like to find a way for it to translate underscores to dashes automatically. In other words: xml.department_manager do "fred end #=> <department-manager>fred</department-manager> I tried hacking Builder::XmlBase.method_missing but got myself all twisted up!
2006 Jan 31
4
Rails bug? Conditions on associations ignored by eager loading
I''m looking for someone to confirm the following as a bug in Rails 1.0 before I post it to Trac. If I use eager loading on an association that has conditions defined, the conditions are ignored. The following example illustrates the problem. I have two tables: create_table "blogs", :force => true do |t| t.column "name", :string end create_table
2007 Mar 21
2
ORA-03106: fatal two-task communication protocol error
Has anyone encountered this error or know how to correct it? I couldn''t find any Rails-specific info about this on google. Here are the circumstances: /usr/local/bin/ruby --version ruby 1.8.4 (2005-12-24) [i686-linux] /usr/local/bin/rails --version Rails 1.1.6 ## Create mcd app rails mcd -d oracle cd mcd ## Create oracle tablespace & user sqlplus ''/ as
2006 Jul 04
3
OCIError: ORA-00918: column ambiguously defined
Hi all, when I execute the command "rake db:schema:dump" i get this error in the db/schema.rb file. ____________________________________________________ # Could not dump table "region" because of following ActiveRecord::StatementInvalid # OCIError: ORA-00918: column ambiguously defined: SELECT lower(i.index_name) as index_name, i.uniqueness, lowe r(c.column_name) as
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,
2009 Mar 03
2
Passing an SQL fragment in AR save
I have a basic model class TestTime with no customization. class TestTime < ActiveRecord::Base end I would like to pass the following SQL fragment as part of an AR save call to TestTime objects. How and where would I do this in the model? "set c_time=current_time" (current_time is an SQL method, not a variable). -- Posted via http://www.ruby-forum.com/.
2011 Sep 13
4
Changing adapters in ActiveRecord does not change the generated sql
If I establish a new connection with a new adapter (ie. switch from mysql to postgresl) the generated sql is still mysql specific. I tried all sorts of reset methods on AR::Base but to no avail. There must be something being memoized on ActiveRecord base that has to do with the adapter and it doesn''t get cleared when you establish a connection with a new adapter. I know this
2006 Dec 15
6
Newbie: Invalid number dealing with Identity columns in Oracle
Hi all, I wonder how can I solve in RoR the problem of accessing a simple table because the URL http://localhost:3000/customers/show/2.0 is raising an Oracle error OCIError: ORA-01722: invalid number. The reason of this error is because the SELECT statement generated by ActiveRecord tries to invoke the id column as a VARCHAR : "... FROM customers WHERE customers.id =
2006 Jan 25
4
Cannot :order when using :offset and :limit in find
Hello all. I am using the Paginate_with_ajax code as described on the wiki but I am running into the following problem. The following code will work fine and retrieved unsorted records in a hunky dory fashion: @componentlogs = Componentlog.find(:all, :conditions => [ "cl_compname like ?", @criteria ], :offset => offset, :limit => items_per_page ) However if I try and add an
2008 Jan 04
1
eager loading and polymorphic associations
There is a dedicated section about eager loading in the docs. A coworker discovered eager loading does not work in polymorphic associations the hard way :-) so I''ve written a patch that documents it: http://dev.rubyonrails.org/ticket/10610 There are at least a couple of tickets that implement something that would change that though: http://dev.rubyonrails.org/ticket/9640
2006 Mar 31
2
Eager loading of polymorphic associations
Polymorphic associations work great until I try to do some eager loading through :include. In my example, the interface name is ":imagehaver". Here''s my little eagerly loading find line: Image.find(params[:id], :include => :imagehaver) All it gives me is an ActiveRecord::EagerLoadPolymorphicError with no further explanation. I haven''t been able to dig up anything
2005 Aug 04
1
Pagination and :include (eager associations)
I have tried to use eager association with pagination, but the :include option is not supported: Here''s the one-line pagination call without :include @link_pages, @links = paginate :link, :per_page => 10, :order_by => sort_clause and here the work around, using the "classic" method # @link_pages = Paginator.new self, Link.count, 10,
2005 May 01
0
Eager loading with self associations
Hi, I''m new to ruby on rails and I''m trying to make a self association (as when an employee has a manager, whom is also an employee) work with eager loading on postgres, but the generated sql is wrong the two ends of the association are in the same table (setores), the foreign key is setor_pai and the generated SQL contains this: FROM setores LEFT OUTER JOIN setores ON
2006 Jul 31
0
Patch for #3438: Eager loading doesn''t respect :order of associations
Hello all, I still have a patch for #3438 (eager loading doesn''t respect association orders); it passes all unit tests, and has additional unit tests with full coverage. The patch is attached. == The Bug == Author.find(1).posts != Author.find(1, :include => [:posts]).posts if Author has_many :posts, :order => anything. This means that either one must avoid eager loading or
2008 Apr 23
2
Bug in eager loading and polymorphic associations?
Hi friends, i''m usgin the edge version because i need eager loading on polymorphic associations support, but i see this: Message.find(:first, :include => :owner) #This generate this query: SQL (0.000072) SET SQL_AUTO_IS_NULL=0 Message Load (0.000389) SELECT * FROM `messages` User Load (0.001070) SELECT * FROM `users` WHERE (users.id IN (1,2)) And this Message.find(:first,
2006 Jul 03
0
Eager loading of ''is meant to be nil'' Associations
If I ''find'' using :include, and some included associations are null, then looping through the array executing ''if obj[i].assoc'' accesses the database for a second time (as obj.assoc is nil). eg Topic, has_many posts Post has_one email and posts = Post.find(:all, :condition => ''posts.topic_id = 10'', :include =>
2005 Dec 14
0
eager loading all associations
Hi Railers, Is there a way to specify all relations in a :include option while find()ing? I have a model with a lot of associations, and sometimes i would like to query for all them. Something like Model.find(params[:id], :include => :all) would be nice. Alternatively, i don''t know if there is a mehod to retrieve all model''s associations, to do something like
2008 Apr 21
2
Eager Loading Polymorphic Associations
Hi, I''m searching for a method of eager loading polymorphic associations under activerecord 2.0.2. After some initial google-fu I came up with a link to an enhancement that''s been added to edge: http://dev.rubyonrails.org/ticket/8119 Anyone have any idea how long that might take to work its way into a general release? I''m early in development now so I can afford to
2005 Jun 13
1
Question on Eager Associations
Hi - I am trying to use eager associations to cut down on database queries. I have a feeds table, an items table, a categories table, and a categories_items table. feeds have items, and items have many categories (and categories can be assigned to many items), thus the categories_items table which is a many-many join table. I do @feed = Feed.find(1) which works fine, but now I want to use
2005 Jul 26
6
eager associations and limit/offset
Hi, currently the eager association loading via ":include" does not work when a has-many or habtm association is combined with offset/limit (which is required for paginations). This is because in these cases, the result set will contain more than one row per object, but limit/offset works on row numbers. I''ve developed a patch that makes this work by using 2 SQL statements