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 ed32334240..be44f61ea7 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -43,7 +43,7 @@ module Dependencies #:nodoc:
def require_or_load(file_name)
if load?
# Append .rb if we have a bare file name.
- load_file_name = "#{file_name}.rb" unless file_name[-3..-1] == '.rb'
+ load_file_name = (file_name =~ /\.rb$/ ? file_name : "#{file_name}.rb")
# Enable warnings iff this file has not been loaded before.
if history.include?(file_name)