Skip to content
This repository
tree: 2b28575734
Fetching contributors…

Cannot retrieve contributors at this time

file 17 lines (14 sloc) 0.592 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
print "Using native SQLite3\n"
require_dependency 'fixtures/course'
require 'logger'
ActiveRecord::Base.logger = Logger.new("debug.log")

class SqliteError < StandardError
end

def make_connection(clazz, db_definitions_file)
  clazz.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
  File.read("#{File.dirname(__FILE__)}/../../fixtures/db_definitions/#{db_definitions_file}").split(';').each do |command|
    clazz.connection.execute(command) unless command.strip.empty?
  end
end

make_connection(ActiveRecord::Base, 'sqlite.sql')
make_connection(Course, 'sqlite2.sql')
Something went wrong with that request. Please try again.