Sha256: c084acf3d77227d4f505819a899708fed869bbe99667ee81232ca9b888fc228e
Contents?: true
Size: 663 Bytes
Versions: 5
Compression:
Stored size: 663 Bytes
Contents
$LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'rubygems' require 'minitest' require 'active_record' require 'postgresql_cursor' ActiveRecord::Base.establish_connection(adapter: 'postgresql', database: ENV['TEST_DATABASE'] || 'postgresql_cursor_test', username: ENV['TEST_USER'] || ENV['USER'] || 'postgresql_cursor') class Product < ActiveRecord::Base # create table records (id serial primary key); def self.generate(max=1_000) max.times do |i| connection.execute("insert into products values (#{i+1})") end end end Product.destroy_all Product.generate(1000)
Version data entries
5 entries across 5 versions & 1 rubygems