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 550da78 commit 74fb2a1cddfbb089a4fab433612ad255b577d8ff @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
View
6 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 74fb2a1

Please sign in to comment.