Module: ActiveStorage::DBServiceRails70
- Included in:
- Service::DBService
- Defined in:
- lib/active_storage/service/db_service_rails70.rb
Instance Method Summary collapse
Instance Method Details
#compose(source_keys, destination_key) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/active_storage/service/db_service_rails70.rb', line 5 def compose(source_keys, destination_key, **) buffer = nil source_keys.each do |source_key| data = ::ActiveStorageDB::File.find_by!(ref: source_key).data if buffer buffer << data else buffer = data end end ::ActiveStorageDB::File.create!(ref: destination_key, data: buffer) if buffer end |