You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the attachment part of the Post schema? If so, I think you have to create the Post first so that it has an :id. WIthout an :id field, the attachment name generation will not work.
E.g., if the Post is going to have an id == 4, but it has not been created yet, instead of an attachment 4_myimage.png you will get _myimage.png.
(I think this is correct. Still new to it myself.)
Well it's an attachment on the Item schema which belongs to the Post context, but yes. I assumed it would create the record first, then generate the name and upload using some after_create hook. It's looking like this is not the case.
Environment
Expected behavior
Attachment will be uploaded to S3 when object is created with an empty changeset and set of attributes.
Actual behavior
Attachment is not uploaded until object is updated.
As stated above, if I create a new record with an attachment, the attachment is not uploaded to S3 until I update the record.
This works:
This does not:
posts.ex
The text was updated successfully, but these errors were encountered: