aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #33829 from mtsmfm/encode-filenameKasper Timm Hansen2018-09-231-1/+4
|\ | | | | Encode Content-Disposition filenames on send_data and send_file
| * Encode Content-Disposition filenames on send_data and send_fileFumiaki MATSUSHIMA2018-09-131-1/+4
| |
* | Configure Active Storage route prefixChris Bisnett2018-09-142-0/+2
|/ | | | | | | | | | | Applications can configure the route prefix prepended to the Active Storage routes. By default this maintains the previous prefix `/rails/active_storage` but supports custom prefixes. Before this change the route for serving blobs is fixed to `/rails/active_storage/blobs/:signed_id/*filename`. After this change it's possible to configure the route to something like `/files/blobs/:signed_id/*filename`.
* Handle only specifically relevant Azure HTTPErrorsCameron Bothner2018-08-231-5/+7
| | | | | | | | | The Azure gem uses `Azure::Core::Http::HTTPError` for everything: checksum mismatch, missing object, network unavailable, and many more. (https://www.rubydoc.info/github/yaxia/azure-storage-ruby/Azure/Core/Http/HTTPError). Rescuing that class obscures all sorts of configuration errors. We should check the type of error in those rescue blocks, and reraise when needed.
* Revert "Merge pull request #33667 from ↵George Claghorn2018-08-231-13/+7
| | | | | | | cbothner/azure-service-swallowing-all-errors" This reverts commit b204d167c5cfebd59f771d406178e371811ac43a, reversing changes made to de6a200f82a3de399fa685d583503bc88dbc5e9f.
* Handle only specifically relevant Azure HTTPErrorsCameron Bothner2018-08-231-7/+13
| | | | | | | | | The Azure gem uses `Azure::Core::Http::HTTPError` for everything: checksum mismatch, missing object, network unavailable, and many more. (https://www.rubydoc.info/github/yaxia/azure-storage-ruby/Azure/Core/Http/HTTPError). Rescuing that class obscures all sorts of configuration errors. We should check the type of error in those rescue blocks, and reraise when needed.
* Translate service-specific missing object exceptions into a generic oneCameron Bothner2018-08-215-18/+72
| | | | | | | | | `ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise `ActiveStorage::FileNotFoundError` when the corresponding file is missing from the storage service. Services translate service-specific missing object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service and `Errno::ENOENT` for the disk service) into `ActiveStorage::FileNotFoundError`.
* Document all Active Storage error classes [ci skip]George Claghorn2018-08-101-0/+8
|
* Add a generic base class for Active Storage exceptionsGeorge Claghorn2018-08-101-4/+7
| | | | | | Closes #33292. [Andrei Makarov & George Claghorn]
* Extract transformersGeorge Claghorn2018-08-104-0/+127
|
* Camelize instead of classifyingGeorge Claghorn2018-08-061-1/+1
| | | | | | | Avoid mangling service names that end in S: "GCS".classify # => "GC" "GCS".camelize # => "GCS"
* Improve ActiveStorage service adapter error handlingJoel Taylor2018-08-061-1/+3
|
* Fix uploading Tempfiles to Azure StorageGeorge Claghorn2018-08-031-1/+1
| | | | Closes #32530.
* Remove another unused requireGeorge Claghorn2018-08-021-2/+0
|
* Remove unused requireGeorge Claghorn2018-08-011-2/+0
|
* Ignore concurrently-deleted files when deleting by prefix from GCSGeorge Claghorn2018-07-301-1/+7
|
* Update ActiveStorage::Previewer docsGeorge Claghorn2018-07-291-2/+2
| | | | PDFPreviewer became MuPDFPreviewer in 0b717c2. Previewers are simple enough that we can just provide a single example.
* Log streaming downloadsGeorge Claghorn2018-07-261-0/+2
|
* Remove unused attributeGeorge Claghorn2018-07-212-5/+5
|
* Fix replacing many attachments via assign and attachGeorge Claghorn2018-07-171-0/+4
|
* Fix that successive ActiveStorage::Attached::Many#attach calls would ↵George Claghorn2018-07-161-1/+11
| | | | overwrite previous attachments
* Support HTTP Range downloads from diskGeorge Claghorn2018-07-151-4/+4
| | | | Closes #32193.
* Clear attachment changes on reloadGeorge Claghorn2018-07-131-0/+4
|
* Implement ActiveStorage::Attached::{One,Many}#attach in terms of changesGeorge Claghorn2018-07-135-38/+30
|
* Fix that detaching could purgeGeorge Claghorn2018-07-132-2/+2
|
* Fix analyzing new blobs from uploaded files on attachGeorge Claghorn2018-07-131-18/+4
|
* Raise an ArgumentError instead of a RuntimeErrorGeorge Claghorn2018-07-081-1/+1
|
* Store newly-uploaded files on save rather than assignmentGeorge Claghorn2018-07-0712-138/+326
|
* Fix that models can clobber each others' attachment reflectionsGeorge Claghorn2018-07-071-2/+2
| | | | | | | | | | | | | | Consider the following model definitions: class User < ApplicationRecord has_one_attached :avatar end class Group < ApplicationRecord has_one_attached :avatar end If you attempt to reflect on the User model's avatar attachment via User.reflect_on_attachment, you could receive a reflection for the Group model's avatar attachment. Fix this by ensuring that each model class uses its own Hash object to track attachment reflections.
* Remove vestigial require on ActiveStorage GCSServiceBibek Shrestha2018-07-041-1/+0
| | | | | | | | | | | | The file `filename.rb` as mentioned in `require "active_storage/filename"` belongs to the `app` folder while GCSService belongs to the lib folder. Looking at the git blame, it was added in commit https://github.com/rails/rails/commit/ccac681122db9747fec9512076772bca345e24b9#diff-bda6a610ef1575b2c8458c96b7f12578 where ActiveStorage::Filename was actually used. But it is no longer required on master and therefore can be removed. This allows anyone to use GCSService directly without enabling ActiveStorage engine.
* Tweak Previewer::PopplerPDFPreviewer#pdftoppm_exists?utilum2018-06-291-1/+1
| | | | Does not warn `instance variable @pdftoppm_exists not initialized`.
* Update service.rbishanray2018-06-241-1/+1
|
* Permit configuring the default service URL expiryGeorge Claghorn2018-06-213-2/+2
|
* Update ffmpeg -> FFmpeg, mutools|mupdf -> muPDFutilum2018-06-082-3/+3
| | | | [ci skip]
* Exclude upload time from instrumented preview timeGeorge Claghorn2018-06-031-5/+10
|
* Merge pull request #33018 from kddeisz/defined-attachmentsRafael França2018-06-013-0/+85
|\ | | | | ActiveStorage reflection
| * Ensure reflection_class_for is privateKevin Deisz2018-05-311-12/+13
| |
| * Move ActiveStorage reflection logic entirely into ActiveStorageKevin Deisz2018-05-312-0/+72
| |
| * Reflection for attachmentsKevin Deisz2018-05-301-0/+12
| | | | | | | | Add the ability to reflect on the attachments that have been defined using ActiveRecord::Reflection.
* | Include blob ID in tempfile name for debugging convenienceGeorge Claghorn2018-05-301-5/+1
|/
* Fix referenceGeorge Claghorn2018-05-281-1/+1
|
* Verify integrity after chunked downloadGeorge Claghorn2018-05-283-2/+11
|
* Hide Active Storage migration installation task (#33007)utilum2018-05-281-0/+3
| | | Resolves #33006
* Change video preview format from PNG to JPGJavan Makhmali2018-05-231-3/+2
|
* Permit opening a blob in a custom tempdirGeorge Claghorn2018-05-173-7/+12
|
* Generate getter and setter methods in mixinJosh Susser2018-05-171-2/+2
| | | | | | | | | | | Generated attachment getter and setter methods are created within the model's `GeneratedAssociationMethods` module to allow overriding and composition using `super`. Includes tests for new functionality. Co-authored-by: Josh Susser <josh@hasmanythrough.com> Co-authored-by: Jamon Douglas <terrildouglas@gmail.com>
* Remove unused `require "active_support/core_ext/string/filters"`Ryuta Kamizono2018-05-171-2/+0
|
* Add ActiveStorage::Previewer#tempdirGeorge Claghorn2018-05-161-1/+5
|
* Add missing block parametersGeorge Claghorn2018-05-162-2/+2
|
* Add ActiveStorage::Blob#openGeorge Claghorn2018-05-164-7/+59
| | | | [David Robertson & George Claghorn]