Skip to content

Commit 9043dc5

Browse files
authored
Merge pull request rails#52366 from Shopify/require-hotloop
Avoid late require calls in potential hot spots
2 parents 89bf564 + 7836a16 commit 9043dc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activesupport/lib/active_support/configuration_file.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def parse(context: nil, **options)
3333

3434
private
3535
def read(content_path)
36-
require "yaml"
37-
require "erb"
36+
require "yaml" unless defined?(YAML)
37+
require "erb" unless defined?(ERB)
3838

3939
File.read(content_path).tap do |content|
4040
if content.include?("\u00A0")

0 commit comments

Comments
 (0)