Skip to content
Browse files

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
  • Loading branch information...
1 parent 78d6cc0 commit 7e70fc1e9d1bd3f1d0be37fcf23dae1736ccbaaa @NZKoz NZKoz committed Oct 6, 2005
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
View
6 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -50,8 +50,10 @@ def parse_config!(config)
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

0 comments on commit 7e70fc1

Please sign in to comment.
Something went wrong with that request. Please try again.