aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/core_ext/load_error.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/core_ext/load_error.rb b/activesupport/lib/active_support/core_ext/load_error.rb
index 6165e95443..f36a21818f 100644
--- a/activesupport/lib/active_support/core_ext/load_error.rb
+++ b/activesupport/lib/active_support/core_ext/load_error.rb
@@ -24,15 +24,12 @@ class MissingSourceFile < LoadError #:nodoc:
] unless defined?(REGEXPS)
end
-module ActiveSupport #:nodoc:
- module CoreExtensions #:nodoc:
- module LoadErrorExtensions #:nodoc:
- module LoadErrorClassMethods #:nodoc:
- def new(*args)
- (self == LoadError && MissingSourceFile.from_message(args.first)) || super
- end
- end
- ::LoadError.extend(LoadErrorClassMethods)
+class LoadError
+ def self.new(*args)
+ if self == LoadError
+ MissingSourceFile.from_message(args.first)
+ else
+ super
end
end
end