diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index ee3a6bf8c08..e94b67cbdc1 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -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 diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 1cfcd30c5b9..37297f04964 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -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