aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-08-25 03:08:45 +0200
committerXavier Noria <fxn@hashref.com>2012-08-25 03:08:45 +0200
commit4fbd350dca336e5c5b974b42fb97a1d6da74c366 (patch)
tree881332083b9d73bf74686aa137a9472ccb0c64b9 /activesupport/lib
parent148e33058cf4b8c6197bdc8c78b28bfd018d051f (diff)
downloadrails-4fbd350dca336e5c5b974b42fb97a1d6da74c366.tar.gz
rails-4fbd350dca336e5c5b974b42fb97a1d6da74c366.tar.bz2
rails-4fbd350dca336e5c5b974b42fb97a1d6da74c366.zip
instead of returning $& if =~ succeeds, use String#[]
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/dependencies.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index d3a37f28c8..059eb4cd2d 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -443,7 +443,7 @@ module ActiveSupport #:nodoc:
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