aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app
Commit message (Collapse)AuthorAgeFilesLines
* ASt direct uploads: account for <button type="submit"> elementsTasos Maschalidis2018-11-242-4/+4
|
* update activestorage attachment model documentation reflect recent behavior ↵Kyle Keesling2018-10-241-3/+2
| | | | changes
* Use content_mime_typeGraham Conzett2018-10-081-2/+1
|
* Fix issue ActiveStorage direct upload diskGraham Conzett2018-10-071-1/+2
| | | | | | Fix an issue in ActiveStorage where a direct upload to disk storage would fail due to a content type mismatch if the file was uploaded using a mime-type synonym.
* Merge pull request #33829 from mtsmfm/encode-filenameKasper Timm Hansen2018-09-232-42/+0
|\ | | | | Encode Content-Disposition filenames on send_data and send_file
| * Encode Content-Disposition filenames on send_data and send_fileFumiaki MATSUSHIMA2018-09-132-42/+0
| |
* | Raise `ActiveRecord::InvalidForeignKey` in `before_destroy` for a blob if ↵bogdanvlviv2018-09-161-0/+4
|/ | | | | | | | | | | | | | | attachments exist The issue #32584 was fixed in #33405 by adding foreign key constraint to the `active_storage_attachments` table for blobs. This commit implements fix on app-level in order to ensure that users can't delete a blob with attachments even if they don't have the foreign key constraint. See a related discussion in the Campfire: https://3.basecamp.com/3076981/buckets/24956/chats/12416418@1236718899 Note that, we should backport it to `5-2-stable` too. Related to #33405
* Fix zero-byte files uploadMarcelo Perini Veloso2018-09-061-1/+5
|
* Merge pull request #33666 from ↵George Claghorn2018-08-221-0/+2
|\ | | | | | | | | cbothner/fail-gracefully-from-activestorage-file-not-found Fail more gracefully from ActiveStorage missing file exceptions
| * Respond with 404 in ActiveStorage::DiskController#show when file missingCameron Bothner2018-08-211-0/+2
| | | | | | | | | | | | `ActiveStorage::DiskController#show` generates a 404 Not Found response when the requested file is missing from the disk service. It previously raised `Errno::ENOENT`.
* | activestorage: yarn buildbogdanvlviv2018-08-191-4/+4
| | | | | | | | Context https://github.com/rails/rails/pull/33413#issuecomment-414137587
* | Retry ActiveStorage::AnalyzeJobs on download integrity check failuresGeorge Claghorn2018-08-191-0/+2
| |
* | Enable multiple submit buttons for Active Storage formsChris Seelus2018-08-182-2/+22
|/
* Extract ActiveStorage::SetCurrentGeorge Claghorn2018-08-162-5/+18
| | | | Provide a handy concern for custom Active Storage controllers that can't inherit from ActiveStorage::BaseController.
* Extract transformersGeorge Claghorn2018-08-102-70/+19
|
* DRY up web image checks in ActiveStorage::VariantGeorge Claghorn2018-08-091-18/+24
|
* Retry ActiveStorage::PurgeJobs on DB deadlockGeorge Claghorn2018-07-311-0/+1
|
* Guard against missing blobs caused by concurrent purgesGeorge Claghorn2018-07-301-3/+3
|
* Clarify conditionGeorge Claghorn2018-07-271-1/+1
| | | | && binds tighter than || in JavaScript, but we ought not expect readers to remember language trivia.
* Fix directly uploading zero-byte filesGeorge Claghorn2018-07-272-2/+2
| | | | Closes #33450.
* Ignore ActiveRecord::InvalidForeignKey in ActiveStorage::Blob#purgeJasper Martin2018-07-262-1/+2
| | | Do nothing instead of raising an error when it’s called on an attached blob.
* Discard ActiveStorage::PurgeJobs on ActiveRecord::InvalidForeignKeyGeorge Claghorn2018-07-201-1/+1
|
* Delete attachment before purging blobGeorge Claghorn2018-07-191-2/+2
|
* Destroy blob record before deleting stored dataGeorge Claghorn2018-07-191-1/+1
|
* Link between ActiveStorage::Blob#purge, #purge_later, and #delete [ci skip]George Claghorn2018-07-181-5/+5
|
* Clarify the ActiveStorage::Attachment#purge and #purge_later docsGeorge Claghorn2018-07-181-2/+2
| | | | Link to the corresponding ActiveStorage::Blob methods, whose docs more accurately describe their effects. [ci skip]
* Restore inadvertently-removed fallbackGeorge Claghorn2018-07-151-1/+2
|
* Support HTTP Range downloads from diskGeorge Claghorn2018-07-151-14/+15
| | | | Closes #32193.
* Discard ActiveStorage::PurgeJobs for missing blobsGeorge Claghorn2018-07-111-0/+2
|
* Remove overly-broad retry in ActiveStorage::PurgeJobGeorge Claghorn2018-07-111-3/+0
| | | | We've never intentionally tripped this retry in production. Add retries for specific errors as needed.
* Store newly-uploaded files on save rather than assignmentGeorge Claghorn2018-07-072-10/+29
|
* Permit configuring the default service URL expiryGeorge Claghorn2018-06-214-5/+5
|
* Update ffmpeg -> FFmpeg, mutools|mupdf -> muPDFutilum2018-06-081-2/+2
| | | | [ci skip]
* Include blob ID in tempfile name for debugging convenienceGeorge Claghorn2018-05-301-0/+10
|
* Verify integrity after chunked downloadGeorge Claghorn2018-05-281-0/+2
|
* Avoid 2.6 warning: shadowing outer local variable - listutilum2018-05-231-8/+6
|
* Disable variant options when false or nil presentJacob Smith2018-05-211-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In response to https://github.com/rails/rails/issues/32917 In the current implementation, ActiveStorage passes all options to the underlying processor, including when a key has a value of false. For example, passing: ``` avatar.variant(resize: "100x100", monochrome: false, flip: "-90") ``` will return a monochrome image (or an error, pending on ImageMagick configuration) because it passes `-monochrome false` to the command (but the command line does not allow disabling flags this way, as usually a user would omit the flag entirely to disable that feature). This fix only passes those keys forward to the underlying processor if the value responds to `present?`. In practice, this means that `false` or `nil` will be filtered out before going to the processor. One possible use case would be for a user to be able to apply different filters to an avatar. The code might look something like: ``` variant_options = { monochrome: params[:monochrome], resize: params[:resize] } avatar.variant(*variant_options) ``` Obviously some sanitization may be beneficial in a real-world scenario, but this type of configuration object could be used in many other places as well. - Add removing falsy values from varaints to changelog - The entirety of #image_processing_transformation inject block was wrapped in `list.tap` to guard against the default `nil` being returned if no conditional was called. - add test for explicitly true variant options
* Permit opening a blob in a custom tempdirGeorge Claghorn2018-05-171-2/+2
|
* Active storage: Image variant options not correctlucfranken2018-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Steps to reproduce Using Rails 5.2.0 When following this example: http://api.rubyonrails.org/classes/ActiveStorage/Variant.html `avatar.variant(resize: "100x100", monochrome: true, flip: "-90")` ### Expected behavior Image should be rendered as flipped. ### Actual behavior I get an error: > failed with error: gm mogrify: Unrecognized option (-90). ### Fix: According to: https://github.com/minimagick/minimagick the option should be called rotate: `avatar.variant(resize: "100x100", monochrome: true, rotate: "-90")` So **flip** changed to **rotate**. ### System configuration **Rails version**: 5.2.0 **Ruby version**: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
* Add ActiveStorage::Blob#openGeorge Claghorn2018-05-162-5/+8
| | | | [David Robertson & George Claghorn]
* Add option to ActiveStorage::Blob to set extract_content_type_from_ioRyan Davidson2018-05-081-7/+10
| | | | | | | This adds a boolean argument called identify to ActiveStorage::Blob methods #create_after_upload, #build_after_upload and #upload. It allows a user to bypass the automatic content_type inference from the io.
* Stream blobs from diskGeorge Claghorn2018-05-021-2/+13
|
* Unminify activestorage.jsJavan Makhmali2018-04-251-1/+930
|
* Don't swallow LoadError raised for missing libvipsJanko Marohnić2018-04-231-3/+7
|
* Recommend using :resize_to_fit after allJanko Marohnić2018-04-234-12/+12
|
* Remove warning that image will be loaded into memoryJanko Marohnić2018-04-231-4/+4
| | | | | This is not true anymore, the image will be downloaded into a temporary file in a streaming fashion.
* Show ImageProcessing macros in a dedicated exampleJanko Marohnić2018-04-231-13/+12
|
* Ensure result file is deleted on uploading errorsJanko Marohnić2018-04-221-4/+10
|
* Rename ActiveStorage.processor to .variant_processorJanko Marohnić2018-04-222-4/+4
|
* Use ImageProcessing gem for ActiveStorage variantsJanko Marohnić2018-04-182-52/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ImageProcessing gem is a wrapper around MiniMagick and ruby-vips, and implements an interface for common image resizing and processing. This is the canonical image processing gem recommended in [Shrine], and that's where it developed from. The initial implementation was extracted from Refile, which also implements on-the-fly transformations. Some features that ImageProcessing gem adds on top of MiniMagick: * resizing macros - #resize_to_limit - #resize_to_fit - #resize_to_fill - #resize_and_pad * automatic orientation * automatic thumbnail sharpening * avoids the complex and inefficient MiniMagick::Image class * will use "magick" instead of "convert" on ImageMagick 7 However, the biggest feature of the ImageProcessing gem is that it has an alternative implementation that uses libvips. Libvips is an alternative to ImageMagick that can process images very rapidly (we've seen up 10x faster than ImageMagick). What's great is that the ImageProcessing gem provides the same interface for both implementations. The macros are named the same, and the libvips implementation does auto orientation and thumbnail sharpening as well; only the operations/options specific to ImageMagick/libvips differ. The integration provided by this PR should work for both implementations. The plan is to introduce the ImageProcessing backend in Rails 6.0 as the default backend and deprecate the MiniMagick backend, then in Rails 6.1 remove the MiniMagick backend.