-
Notifications
You must be signed in to change notification settings - Fork 276
Open
Description
Brief Description
I have a simple file attachment uploader that stores files in GCS storage. On my model before_save callback I store the size of the image file in my database by accessing:
class Comment
before_save :store_file_size
include CommentUploader::Attachment(:file)
def store_file_size
file.size
end
end
Expected behavior
The tempfile plugin should not affect normal behavior that works fine when the tempfile plugin is not used.
Actual behavior
When I add the tempfile plugin, I get a Shrine::Error - uploaded file must be opened.
Calling file.open prior to file.size or file.dimensions works. The tempfile plugin is forcing a requirement to call file.open
System configuration
Ruby version: 2.5.0
Shrine version: 3.3.0
Thanks for an amazing gem and for your consideration of this issue.
Metadata
Metadata
Assignees
Labels
No labels