Permalink
Browse files

instead of returning $& if =~ succeeds, use String#[]

  • Loading branch information...
1 parent 148e330 commit 4fbd350dca336e5c5b974b42fb97a1d6da74c366 @fxn fxn committed Aug 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/dependencies.rb
@@ -443,7 +443,7 @@ def autoload_module!(into, const_name, qualified_name, path_suffix)
def load_file(path, const_paths = loadable_constants_for_path(path))
log_call path, const_paths
const_paths = [const_paths].compact unless const_paths.is_a? Array
- parent_paths = const_paths.collect { |const_path| /.*(?=::)/ =~ const_path ? $& : :Object }
+ parent_paths = const_paths.collect { |const_path| const_path[/.*(?=::)/] || :Object }
result = nil
newly_defined_paths = new_constants_in(*parent_paths) do

0 comments on commit 4fbd350

Please sign in to comment.