mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Allow in memory sqlite DBs when RAILS_ROOT is defined [blair@orcaware.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2476 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -50,8 +50,10 @@ module ActiveRecord
|
||||
raise ArgumentError, "No database file specified. Missing argument: dbfile"
|
||||
end
|
||||
|
||||
# Allow database path relative to RAILS_ROOT.
|
||||
if Object.const_defined?(:RAILS_ROOT)
|
||||
# Allow database path relative to RAILS_ROOT, but only if
|
||||
# the database path is not the special path that tells
|
||||
# Sqlite build a database only in memory.
|
||||
if Object.const_defined?(:RAILS_ROOT) && ':memory:' != config[:dbfile]
|
||||
config[:dbfile] = File.expand_path(config[:dbfile], RAILS_ROOT)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user