Permalink
Browse files

config[:database] should be a string

This change was breaking the Railties tests. See
https://travis-ci.org/rails/rails/jobs/9865969
  • Loading branch information...
1 parent 9281adc commit b6c971e123e0c20ddf2c8e1f43feef8c9500d17b @rafaelfranca rafaelfranca committed Aug 5, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
@@ -18,9 +18,9 @@ def sqlite3_connection(config)
# the database path is not the special path that tells
# Sqlite to build a database only in memory.
if ':memory:' != config[:database]
- config[:database] = Pathname.new(config[:database])
- config[:database] = config[:database].expand_path(Rails.root) if defined?(Rails.root)
- config[:database].dirname.mkdir unless config[:database].dirname.directory?
+ config[:database] = File.expand_path(config[:database], Rails.root) if defined?(Rails.root)
+ dirname = File.dirname(config[:database])
+ Dir.mkdir(dirname) unless File.directory?(dirname)
end
db = SQLite3::Database.new(

0 comments on commit b6c971e

Please sign in to comment.