Skip to content

Commit 677d375

Browse files
committed
chore: DBServiceRails70: use select(:data) to avoid loading full AR objects
1 parent f7169a8 commit 677d375

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/active_storage/service/db_service_rails70.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def compose(source_keys, destination_key, **)
66
buffer = nil
77
comment = "DBService#compose"
88
source_keys.each do |source_key|
9-
record = ::ActiveStorageDB::File.annotate(comment).find_by(ref: source_key)
9+
record = ::ActiveStorageDB::File.annotate(comment).select(:data).find_by(ref: source_key)
1010
raise ActiveStorage::FileNotFoundError unless record
1111

1212
if buffer

0 commit comments

Comments
 (0)