Permalink
Browse files

Fix Rails root in sqlite adapter

  • Loading branch information...
1 parent c1261b5 commit 4cebd41d9e9764b29a5673a298a71b0c530b2bf6 @josh josh committed Oct 17, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -11,11 +11,11 @@ def parse_sqlite_config!(config)
raise ArgumentError, "No database file specified. Missing argument: database"
end
- # Allow database path relative to RAILS_ROOT, but only if
+ # Allow database path relative to Rails.root, but only if
# the database path is not the special path that tells
# Sqlite to build a database only in memory.
- if Object.const_defined?(:RAILS_ROOT) && ':memory:' != config[:database]
- config[:database] = File.expand_path(config[:database], RAILS_ROOT)
+ if Object.const_defined?(:Rails) && ':memory:' != config[:database]
+ config[:database] = File.expand_path(config[:database], Rails.root)
end
end
end

0 comments on commit 4cebd41

Please sign in to comment.