Skip to content

Commit

Permalink
we're not supporting SQLite 2
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Dec 24, 2012
1 parent 7ab469c commit a2ce1de
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions actionpack/test/active_record_unit.rb
Expand Up @@ -45,19 +45,11 @@ def setup
def setup_connection
if Object.const_defined?(:ActiveRecord)
defaults = { :database => ':memory:' }
begin
adapter = defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3'
options = defaults.merge :adapter => adapter, :timeout => 500
ActiveRecord::Base.establish_connection(options)
ActiveRecord::Base.configurations = { 'sqlite3_ar_integration' => options }
ActiveRecord::Base.connection
rescue Exception # errors from establishing a connection
$stderr.puts 'SQLite 3 unavailable; trying SQLite 2.'
options = defaults.merge :adapter => 'sqlite'
ActiveRecord::Base.establish_connection(options)
ActiveRecord::Base.configurations = { 'sqlite2_ar_integration' => options }
ActiveRecord::Base.connection
end
adapter = defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3'
options = defaults.merge :adapter => adapter, :timeout => 500
ActiveRecord::Base.establish_connection(options)
ActiveRecord::Base.configurations = { 'sqlite3_ar_integration' => options }
ActiveRecord::Base.connection

Object.send(:const_set, :QUOTED_TYPE, ActiveRecord::Base.connection.quote_column_name('type')) unless Object.const_defined?(:QUOTED_TYPE)
else
Expand Down

0 comments on commit a2ce1de

Please sign in to comment.