mirror of https://github.com/rails/rails
use File.binread to pull in the schema cache
This commit is contained in:
parent
3352e3b610
commit
3b378a7840
|
@ -115,7 +115,7 @@ module ActiveRecord
|
|||
if app.config.use_schema_cache_dump
|
||||
filename = File.join(app.config.paths["db"].first, "schema_cache.dump")
|
||||
if File.file?(filename)
|
||||
cache = Marshal.load(open(filename, 'rb') { |f| f.read })
|
||||
cache = Marshal.load File.binread filename
|
||||
if cache.version == ActiveRecord::Migrator.current_version
|
||||
ActiveRecord::Base.connection.schema_cache = cache
|
||||
else
|
||||
|
|
|
@ -106,7 +106,7 @@ module Rails
|
|||
# YAML::load.
|
||||
def database_configuration
|
||||
require 'erb'
|
||||
YAML::load(ERB.new(IO.read(paths["config/database"].first)).result)
|
||||
YAML.load ERB.new(IO.read(paths["config/database"].first)).result
|
||||
end
|
||||
|
||||
def log_level
|
||||
|
|
Loading…
Reference in New Issue