Sha256: e127ee1c7ee345b0d3f227d8e3a99fb360148ad512eb951a038298c965f8702b

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'active_record'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'postgresql_cursor'

ActiveRecord::Base.establish_connection :database=>'allen_test', :adapter=>'postgresql', :username=>'allen'
class Model < ActiveRecord::Base
  #set_table_name "records"
  self.table_name = "records"

  # create table records (id serial primary key);
  def self.generate(max=1_000_000)
    max.times do
      connection.execute("insert into records values (nextval('records_id_seq'::regclass))")
    end
  end
end

Model.generate(1000) if Model.count == 0

class Test::Unit::TestCase
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
postgresql_cursor-0.4.2 test/helper.rb
postgresql_cursor-0.4.1 test/helper.rb
postgresql_cursor-0.4.0 test/helper.rb