diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 5a49fc2d2f5a103da3db99f079da38b552077e02..c9c2892ba40a889c4a8b4b472bab224c73a42312 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/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