Froze rails gems
[depot.git] / vendor / rails / activerecord / test / connections / native_sqlite3 / in_memory_connection.rb
1 print "Using native SQLite3\n"
2 require_dependency 'models/course'
3 require 'logger'
4 ActiveRecord::Base.logger = Logger.new("debug.log")
5
6 class SqliteError < StandardError
7 end
8
9 def make_connection(clazz, db_definitions_file)
10 clazz.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
11 File.read(SCHEMA_ROOT + "/#{db_definitions_file}").split(';').each do |command|
12 clazz.connection.execute(command) unless command.strip.empty?
13 end
14 end
15
16 make_connection(ActiveRecord::Base, 'sqlite.sql')
17 make_connection(Course, 'sqlite2.sql')
18 load(SCHEMA_ROOT + "/schema.rb")