diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-17 19:46:32 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-17 19:46:32 -0300 |
commit | 4b339f44bdaa307004db2345ac9c950d9f508814 (patch) | |
tree | 855748bc8f1df1a8b1d327810be229af05ee522e /activerecord/test/connections | |
parent | c01c8967a02537f132d437d5ae15332982119651 (diff) | |
parent | 25e5b0c4a8d0045715a6ad11e2898585826e4e9b (diff) | |
download | rails-4b339f44bdaa307004db2345ac9c950d9f508814.tar.gz rails-4b339f44bdaa307004db2345ac9c950d9f508814.tar.bz2 rails-4b339f44bdaa307004db2345ac9c950d9f508814.zip |
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/test/connections')
-rw-r--r-- | activerecord/test/connections/native_sqlite/connection.rb | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/activerecord/test/connections/native_sqlite/connection.rb b/activerecord/test/connections/native_sqlite/connection.rb deleted file mode 100644 index fea985d8a3..0000000000 --- a/activerecord/test/connections/native_sqlite/connection.rb +++ /dev/null @@ -1,25 +0,0 @@ -print "Using native SQlite\n" -require_dependency 'models/course' -require 'logger' -ActiveRecord::Base.logger = Logger.new("debug.log") - -class SqliteError < StandardError -end - -BASE_DIR = FIXTURES_ROOT -sqlite_test_db = "#{BASE_DIR}/fixture_database.sqlite" -sqlite_test_db2 = "#{BASE_DIR}/fixture_database_2.sqlite" - -def make_connection(clazz, db_file) - ActiveRecord::Base.configurations = { clazz.name => { :adapter => 'sqlite', :database => db_file } } - unless File.exist?(db_file) - puts "SQLite database not found at #{db_file}. Rebuilding it." - sqlite_command = %Q{sqlite "#{db_file}" "create table a (a integer); drop table a;"} - puts "Executing '#{sqlite_command}'" - raise SqliteError.new("Seems that there is no sqlite executable available") unless system(sqlite_command) - end - clazz.establish_connection(clazz.name) -end - -make_connection(ActiveRecord::Base, sqlite_test_db) -make_connection(Course, sqlite_test_db2) |