use File.binread to pull in the schema cache

This commit is contained in:
Aaron Patterson 2012-04-03 15:56:40 -07:00
parent 3352e3b610
commit 3b378a7840
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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