diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index ee7566f335fd4d6925314a4ba1cb2d072ff625af..22b5e434c8c0d4c8f8490744731ac3dd93c8167a 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -177,6 +177,7 @@ def require_or_load(file_name) end def require_dependency(file_name, message = "No such file to load -- %s") + raise ArgumentError, "the file name must be a String -- you passed #{file_name.inspect}" Dependencies.depend_on(file_name, false, message) end diff --git a/railties/lib/rails/application/metal_loader.rb b/railties/lib/rails/application/metal_loader.rb index c0f2e4f948049594d03cd28f22049a356f946c2a..2a43fa7892ff41fe5806258901a6d61d09493e8a 100644 --- a/railties/lib/rails/application/metal_loader.rb +++ b/railties/lib/rails/application/metal_loader.rb @@ -34,7 +34,7 @@ def load_metals!(list) Dir.glob("#{path}/**/*.rb").sort.each do |metal_path| metal = metal_path.sub(matcher, '\1').to_sym next unless list.include?(metal) || list.include?(:all) - require_dependency metal + require_dependency metal.to_s metals << metal end end