Permalink
Browse files

use File.binread to pull in the schema cache

  • Loading branch information...
1 parent 3352e3b commit 3b378a7840c8c2a46935c73dc56d94d4b6fcee9e @tenderlove tenderlove committed Apr 3, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 activerecord/lib/active_record/railtie.rb
  2. +1 −1 railties/lib/rails/application/configuration.rb
@@ -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

0 comments on commit 3b378a7

Please sign in to comment.