1 print
"Using native SQLite3\n"
2 require_dependency
'models/course'
4 ActiveRecord
::Base.logger
= Logger
.new("debug.log")
6 class SqliteError
< StandardError
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
?
16 make_connection(ActiveRecord
::Base, 'sqlite.sql')
17 make_connection(Course
, 'sqlite2.sql')
18 load(SCHEMA_ROOT
+ "/schema.rb")