提交 4cebd41d 编写于 作者: J Joshua Peek

Fix Rails root in sqlite adapter

上级 c1261b54
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册