similar to: API documentation for find_in_batches

Displaying 20 results from an estimated 500 matches similar to: "API documentation for find_in_batches"

2010 Dec 30
1
find_in_batches + query_cache = bloat
We''ve been using find_in_batches to reduce memory usage, and recently noticed one of our more intensive background processes had a huge memory footprint (600mb+) and was getting killed by our memory monitor. We were unable to reproduce this in development, and after investigation, the culprit is query_cache. Wrapping the task in ActiveRecord::Base#uncached kept the task stable (~200mb),
2009 Apr 02
7
Announcing a new Ruby journal
2 April 2009 My name is Martin Streicher. I am pleased to announce three new publications dedicated to web developers. Red: The Journal of Ruby Development Facade: The Journal of Front-end Development Tabula: The Journal of Open Source Database Development The three publications obviously have a great number of topics in common between then, and much that is unique. Where ever possible,
2010 Aug 28
1
find_in_batches vs limit
Is the :limit option in the regular find call effectively same as doing find_in_batches? or does doing something like the following loads "all" of the record and then returns only 5? find(:all, :conditions => [''age > ?'', age], :limit => 5) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2013 Jul 21
4
how to use activemodel collection.build for a has_many :through association
Hi all, In my controller I am doing the following to populate a nested form for a has_many through association: def new @specification = Specification.new Component.find_each.each do |component| @specification.component_specifications.build(:component_id => component.id) end The idea being whenever someone creates or edits a form, it will be populated with all
2011 Jan 11
9
Can I omit respond_with.
If I don''t want xml results but only html can I omit respond_with in some actions? For example index from: respond_with(@sectors = Sector.all) becomes only @sectors = Sector.all isn''t it? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2012 Mar 28
2
Making Knitr work
Might not be the best place to ask, but i could get lucky.. I have setup an eclipse environment to write sweave files lately and wanted to switch to knitr. I could get it to work on easy files, but my earlier written sweave file fails to be knit properly. Here is the error message: Quitting from lines 273-276: Error in setwd(base.dir) : kann Arbeitsverzeichnis nicht wechseln (it says: cannot
2012 Aug 02
4
Subseting
Hi everyone I have banking data set in long format with 4 columns.One of these columns is bank name which consist of 49 banks and I want the data for only 40 banks out of these 49 so can anyone help me on how to get this 40 banks data My data looks like Year Name totalliabilties assets 1990 a 90 10 1991 a 89 48 1992 a 87
2009 Jul 04
9
prevent orphan records
If I have belongs_to :user Do I need to have validates_presence_of :user_id ? Does Rails validate the presence of :user_id automatically if I have belongs_to :user? In other words, does Rails prevent against creating orphan records that belong to non-existent users? Thanks. -- Posted via http://www.ruby-forum.com/.
2012 Jul 10
2
define stuff to be only usable in the same file
Hello R-Help! I've looked around and have not found: A simple(short) way to hide functions and variables from the global environment. What i want is for a few of them to only be accessable from the scriptfile they're in. I probably could do fun things with environments , but that seems quite a hassle. As example: I have a file that gets me stuff from the database and creates an R object
2012 Oct 09
2
append for .Rdata?
Can i somehow append objects to an .Rdata file? I didn't see an option for it in the save() method. dump() won't work since i have s4 objects in there.
2012 Oct 10
2
Strange email i'm getting whenever i post to the list
From: ?????? <NAVER-MAILER at naver.com> Subject: [???? ??] envy721c at naver.cobSDsnLzroZwg66mU7J287J20IOyghOyGoeuQmOyngCDrqrvtlojsig==teuLiOuLpC4= The only plain english in the message is that the mail was denied by the receiver Anyone else getting this?
2012 Apr 27
2
Where would i put feature requests for a library?
Hi! If i found a problem with the code of one of the libraries (not core), or, in my current case, would wish something minor changed for convenience, where can i get contact? Can i put it in the "official" bug repository? (Problem discription for anyone interested: Why call the default function kpca for a matrix with kpar=list(sigma=0.2), instead of putting this default sigma into the
2008 Sep 24
1
TextMate and RSpec
I have to persist some data in the database to test the interactions between two of my models. One model has a serial number attribute that is unique, so it must be entered once and only once. rake spec deletes all the data, allowing my tests to pass. . Running rspec under TextMate produces a fail, however, because the data in tables remain. This is somewhat inconsistent, too. Running it
2013 Oct 25
6
Migrate postgresql database to uuid
Hi all, I am using rails 3.1 and ruby 1.9.3,Now i want to use uuid concept in rails 3 for existing data so i did like :- create_table :posts, :id => false do |t| t.string :uuid, :limit => 36, :primary => true end ActiveRecord::Base.class_eval do # old rails versions set_primary_key ''uuid'' before_create :generate_uuid def generate_uuid self.id =
2011 Apr 15
2
ActionMailer - Setting Header Values - Version Issues
When I first started using Rails, actionmailer set email header values by assigning values to instance variables within a model method. There were some specific instance variables such as ''subject'', ''from'', etc. Header values for which there was no specific instance variable assigned could be set using the @headers hash. This hash could be used to set the
2012 Jan 11
4
ActiveRecord: ar-each_model
Hi, today I went into a problem, when I had to iterate over a big result set. ActiveRecord produces a huge array of model instances, which consumed 1GB of memory on my machine. A comparable perl DBI script only used some KB for iterating over the result set. Then I was suggested to use batch (#find_each) for the problem. But basically batch does the same thing by splitting the query into several
2012 Dec 20
2
Filling Lists or Arrays of variable dimensions
Following problem: Say you have a bunch of parameters and want to produce results for all combinations of those: height<-c("high","low") width<-c("slim","wide") then what i used to do was something like this: l<-list() for(h in height){ l[[h]]<-list() for(w in width){ l[[h]][[w]] <- doSomething() } } Now those parameters aren't
2009 Oct 22
2
ruby-debug and Ruby 1.9.1
Has anyone built ruby-debug for Ruby 1.9.1? I am on Leopard. A check around the Web yielded issues with the pair, but no solution (I''ll keep looking), hence my question. Martin
2012 Mar 26
1
normalization of multi-value string variable
Hi All, I need to normalize/scale string variable which represents interests of customers (e.g., 'cycling, rollerblading, swimming' etc). Does anybody know how to do this, I want then use it along with other numeric variables for SVM classification. Appreciate for any advice. -Alex [[alternative HTML version deleted]]
2012 Apr 03
1
e1071 tune.control() random parameter
I'm not sure what the parameter specifies: random if an integer value is specified, random parameter vectors are drawn from the parameter space. What are the parameter vectors and what is the parameter space? What means drawn? greetings Jessi [[alternative HTML version deleted]]