mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix Rails root in sqlite adapter
This commit is contained in:
parent
c1261b5484
commit
4cebd41d9e
1 changed files with 3 additions and 3 deletions
|
@ -11,11 +11,11 @@ module ActiveRecord
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue