AR_Extension help

I using ar_extensions for mass insertions I found it very effective

all I want is to cache the inserted records into the variable when they
are inserted

something of this kind for a single insert command

cached_record = []
records.each_with_index do |record,i|
cached_record << Record.create(:name => record,:value => i)
end

so that I don’t have to look up in database for the inserted records as
I have them on the fly

is the above kind of code can used with ar_extenions or any other
options

so that when I do
“Record.import()” for mass insertion of the records. The records can
also be cache into a variable

same as above

Note : I don’t want to lookup in database as my database is huge
crossing over five million records so looking up for the inserted
records
e.g
cached_record << Record.all
that a long amount of time close to 20 min

and I don’t need that

Thanks anyway

so that when I do
“Record.import()” for mass insertion of the records. The records can
also be cache into a variable

Perhaps you can save them to your cache before passing them into the
import call? (sorry, don’t use ar_extensions all that much).
-r

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs