提交 3b378a78 编写于 作者: A Aaron Patterson

use File.binread to pull in the schema cache

上级 3352e3b6
......@@ -115,7 +115,7 @@ class Railtie < Rails::Railtie
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 @@ def threadsafe!
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册