1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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