aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-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 467205addf..61823fdeb2 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -333,7 +333,7 @@ module ActiveSupport #:nodoc:
# Search for a file in load_paths matching the provided suffix.
def search_for_file(path_suffix)
- path_suffix = path_suffix + '.rb' unless path_suffix.ends_with? '.rb'
+ path_suffix = "#{path_suffix}.rb" unless path_suffix =~ /\.rb\Z/
load_paths.each do |root|
path = File.join(root, path_suffix)
return path if File.file? path