Skip to content

Commit faeb169

Browse files
byrootfxn
authored andcommitted
Avoid using require_dependency is Zeitwerk is enabled
1 parent 7601b18 commit faeb169

File tree

1 file changed

+5
-3
lines changed
  • activestorage/app/models/active_storage

1 file changed

+5
-3
lines changed

activestorage/app/models/active_storage/blob.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
# update a blob's metadata on a subsequent pass, but you should not update the key or change the uploaded file.
1818
# If you need to create a derivative or otherwise change the blob, simply create a new blob and purge the old one.
1919
class ActiveStorage::Blob < ActiveRecord::Base
20-
require_dependency "active_storage/blob/analyzable"
21-
require_dependency "active_storage/blob/identifiable"
22-
require_dependency "active_storage/blob/representable"
20+
unless Rails.autoloaders.zeitwerk_enabled?
21+
require_dependency "active_storage/blob/analyzable"
22+
require_dependency "active_storage/blob/identifiable"
23+
require_dependency "active_storage/blob/representable"
24+
end
2325

2426
include Analyzable
2527
include Identifiable

0 commit comments

Comments
 (0)