aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2005-10-06 04:56:00 +0000
committerMichael Koziarski <michael@koziarski.com>2005-10-06 04:56:00 +0000
commit7e70fc1e9d1bd3f1d0be37fcf23dae1736ccbaaa (patch)
tree94a76dc0a5aedfe24a83e1b865aaa256829b7615 /activerecord
parent78d6cc085a349bbbcc75b81b07974d3357f70105 (diff)
downloadrails-7e70fc1e9d1bd3f1d0be37fcf23dae1736ccbaaa.tar.gz
rails-7e70fc1e9d1bd3f1d0be37fcf23dae1736ccbaaa.tar.bz2
rails-7e70fc1e9d1bd3f1d0be37fcf23dae1736ccbaaa.zip
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
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
index fe48d1f807..5c7a93e9d0 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -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