app/javascript/activestorage/direct_upload.js in activestorage-7.0.0.alpha2 vs app/javascript/activestorage/direct_upload.js in activestorage-7.0.0.rc1
- old
+ new
@@ -3,24 +3,26 @@
import { BlobUpload } from "./blob_upload"
let id = 0
export class DirectUpload {
- constructor(file, url, delegate) {
+ constructor(file, url, serviceName, attachmentName, delegate) {
this.id = ++id
this.file = file
this.url = url
+ this.serviceName = serviceName
+ this.attachmentName = attachmentName
this.delegate = delegate
}
create(callback) {
FileChecksum.create(this.file, (error, checksum) => {
if (error) {
callback(error)
return
}
- const blob = new BlobRecord(this.file, checksum, this.url)
+ const blob = new BlobRecord(this.file, checksum, this.url, this.serviceName, this.attachmentName)
notify(this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr)
blob.create(error => {
if (error) {
callback(error)