aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | 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-232-16/+25
| | | |
| * | | Ensure result file is deleted on uploading errorsJanko Marohnić2018-04-221-4/+10
| | | |
| * | | Rename ActiveStorage.processor to .variant_processorJanko Marohnić2018-04-225-15/+15
| | | |
| * | | Use ImageProcessing gem for ActiveStorage variantsJanko Marohnić2018-04-187-66/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Halve memory allocation in S3Service#downloadJanko Marohnić2018-04-231-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | Aws::S3::Object#get returns a response with object content wrapped in an in-memory StringIO object. StringIO#read will return a copy of the content, which is not necessary because we can return the content directly using StringIO#string. This halves memory allocation of S3Service#download, because we remove unnecessary content duplication.
* | | Always exclude JSON root from direct_uploads#create responseJavan Makhmali2018-04-102-1/+24
| | | | | | | | | | | | | | | | | | The JavaScript component expects a bare response. Fixes #32365
* | | Merge pull request #32494 from dixpac/as_fix_outdated_documentation_for_variantsRyuta Kamizono2018-04-082-4/+4
|\ \ \ | | | | | | | | Fix leftover references to VariantsController in AS documentation [ci skip]
| * | | Fix leftover references to VariantsController [ci skip]dixpac2018-04-082-4/+4
| | | | | | | | | | | | | | | | | | | | VariantsController has been merged to RepresentationsController, this PR fixes outdated references to VariantsController in ActiveStorage documentation.
* | | | Enable verbose option in ActiveStorageYoshiyuki Hirano2018-04-081-0/+1
|/ / /
* | | Use a current model to provide the host for service urlsAndrew White2018-04-066-6/+26
| | | | | | | | | | | | | | | | | | | | | Trying to pass the current request down to the service so that it can create full urls instead of paths makes the API messy so use a model based on ActiveSupport::CurrentAttributes to provide the current host to services that need it (primarily the disk service).
* | | Protect all active storage controllers agains CSRFRafael Mendonça França2018-04-065-5/+11
| | | | | | | | | | | | | | | Before it was possible to for example use the direct upload controller without using the site.
* | | fixes a bug in IE11 that broke direct uploadskylekeesling2018-04-062-2/+2
| | |
* | | Flip the order of the after_create callbacksDwight Watson2018-03-273-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addresses rails/rails#32247 Add test that checks identify and analyze work in correct order Break out direct upload test helper Review changes for direct-upload test helper
* | | Remove backported CHANGELOG entry [ci skip]Andrew White2018-03-191-8/+0
| | |
* | | Allow full use of the AWS S3 SDK authentication options (#32270)Brian Knight2018-03-193-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | If an explicit AWS key pair and/or region is not provided in config/storage.yml, attempt to use environment variables, shared credentials, or IAM role credentials. Order of precedence is determined by the AWS SDK[1]. [1]: https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html
* | | Remove changelog header for unreleased versionRafael Mendonça França2018-03-131-2/+0
| | | | | | | | | | | | | | | | | | We only add the header when releasing to avoid some conflicts. [ci skip]
* | | Fix Azure signed URL generation with newer client libGeorge Claghorn2018-03-121-6/+4
| | |
* | | Update ASt test services configGeorge Claghorn2018-03-121-0/+0
| | |
* | | Remove path config option from Azure serviceAndrew White2018-03-122-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Active Storage service for Azure Storage has an option called `path` that is ambiguous in meaning. It needs to be set to the primary blob storage endpoint but that can be determined from the blobs client anyway. To simplify the configuration this commit removes the `path` option and gets the endpoint from the blobs client instead. Closes #32225.
* | | Provide an alternative PDF previewer based on PopplerTerence Lee2018-03-067-35/+103
| | | | | | | | | | | | | | | | | | mutool is licensed under the Affero GPL, which has strict distribution requirements. Poppler is licensed under the more liberal GPL, making it a good alternative for those who can't use mutool.
* | | Update test to reflect GCS direct upload header changeGeorge Claghorn2018-03-061-1/+1
| | |
* | | Allow selectively purging attached blobsNicholas Shirley2018-03-063-12/+46
| | |
* | | Remove blank Content-Type from GCS direct upload headersGeorge Claghorn2018-03-061-1/+1
| | | | | | | | | | | | Since we started clearing the client-side blob's type in e0867b3, we no longer need to set a blank Content-Type header before issuing the direct upload request. Fixes that Safari 9 would combine the blank Content-Type header with the blank blob type to produce a Content-Type header containing a single comma, invalidating the request.
* | | Fix purging dependent blobs when attachments aren't loadedGeorge Claghorn2018-03-054-25/+35
| | |
* | | Delete dependent attachments with recordGeorge Claghorn2018-03-053-2/+17
| | | | | | | | | | | | [Matt Jones & George Claghorn]
* | | Correct the ActiveStorage::Service#download_chunk docs [ci skip]George Claghorn2018-03-051-1/+1
| | |
* | | Generate root-relative paths in Active Storage disk service URL methodsGeorge Claghorn2018-03-0514-55/+66
| | | | | | | | | | | | Fixes #32129.
* | | Handle another case where a blob might be erroneously purgedGeorge Claghorn2018-03-042-5/+22
| | |
* | | Avoid purging attached blob when replacing it with itselfGeorge Claghorn2018-03-042-2/+18
| | |
* | | Merge Previews/Variants controller into one Representations controller.Kasper Timm Hansen2018-03-037-100/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since ActiveStorage::Blob::Representable unifies the idea of previews and variants under one roof as representation, we may as well have the controllers follow suit. Thus ActiveStorage::RepresenationsController enters the fray. I've copied the old tests for both previews and variants and unified those as well.
* | | Deprecate `active_support/core_ext/hash/compact`yuuji.yaginuma2018-03-021-2/+0
| |/ |/| | | | | | | Ruby 2.4+ provides `Hash#compact` and `Hash#compact!` natively, so `active_support/core_ext/hash/compact` is no longer necessary.
* | Rebuild activestorage.jsGeorge Claghorn2018-02-281-1/+1
| |
* | Handle file checksumming errorsGeorge Claghorn2018-02-281-0/+6
| |
* | Clear Blob's type before sending itGeorge Claghorn2018-02-262-2/+2
| | | | | | | | Prevent older versions of Chrome from appending a Content-Type header containing the Blob type, rendering the request invalid if we intend not to provide a Content-Type. This behavior was observed in Chrome 58.
* | Update test to reflect direct upload header changesGeorge Claghorn2018-02-261-1/+1
| |
* | Avoid specifying content types for direct uploads to Google Cloud StorageGeorge Claghorn2018-02-262-6/+5
| | | | | | | | Fix customizing the download Content-Type for a directly-uploaded blob via a signed URL. See e8286ee.
* | Remove changelogs for Rails 6.0 since they were backported to `5-2-stable`bogdanvlviv2018-02-261-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove railties' changelog added by 7340596de45dc4c0f62a287b6acc4e71d8ee6c60 since it was backported to `5-2-stable` via ac99916fcf7bf27bb1519d4f7387c6b4c5f0463d Remove activesupport's changelog added by 1077ae96b34b5a1dfbf10ee0c40b1ceb1eb6b30b since it was backported to `5-2-stable` via a2b97e4ffef971607a1be8fc7909f099b6840f36 Remove activesupport's changelog added by 0d41a76d0c693000005d79456dee7f9299f5e8d4 since it was backported to `5-2-stable` via cdce6a709e1cbc98fff009effc3b1b3ce4c7e8db Remove activestorage's changelog added by d57c52a385eb57c6ce8c6d124ab5e186f931d142 since it was backported to `5-2-stable` via 5292cdf59a2052c453d6016c69b90b790cbf2547 Follow up c113bdc9d0c2cffd535ca97aff85c4bdc46b11f6
* | Use lazy load hook to configure ActiveStorage::BlobEugene Kenny2018-02-252-1/+3
| | | | | | | | | | | | | | | | | | `to_prepare` callbacks are run during initialization; using one here meant that `ActiveStorage::Blob` would be loaded when the app boots, which would in turn load `ActiveRecord::Base`. By using a lazy load hook to configure `ActiveStorage::Blob` instead, we can avoid loading `ActiveRecord::Base` unnecessarily.
* | Support varying ICO filesGeorge Claghorn2018-02-244-2/+21
| | | | | | | | Closes #32096.
* | Allow S3 tests against buckets in other regionsAndrew White2018-02-212-2/+2
| | | | | | | | | | Only us-east-1 gives URLs like bucket.s3.amazonaws.com whereas other regions have URLs like s3-eu-west-1.amazonaws.com/ubxd-rails
* | Hoist update for clarityGeorge Claghorn2018-02-202-8/+8
| |
* | Undocument ActiveStorage::IdentificationGeorge Claghorn2018-02-201-1/+1
| |
* | Correct Range header syntaxGeorge Claghorn2018-02-201-1/+1
| |
* | Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-172-1/+8
| | | | | | | | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* | Clean up and consolidate .gitignoresbogdanvlviv2018-02-171-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Global ignores at toplevel .gitignore * Component-specific ignores in each toplevel directory * Remove `actionview/test/tmp/.keep` for JRuby ``` rm actionview/test/tmp/ -fr cd actionview/ bundle exec jruby -Itest test/template/digestor_test.rb ``` Related to #11743, #30392. Closes #29978.
* | Remove support to Ruby 2.2Rafael Mendonça França2018-02-161-1/+1
| | | | | | | | Rails 6 will only support Ruby >= 2.3.
* | Use require_dependency inside Active StorageEugene Kenny2018-02-142-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Active Storage is an engine which means its models, jobs and controllers are autoloaded by Rails rather than Ruby. Unfortunately this means it's subject to the same gotchas as applications, including this one: http://guides.rubyonrails.org/v5.1.4/autoloading_and_reloading_constants.html#when-constants-aren-t-missed-qualified-references On Ruby < 2.5, constants nested under classes can't be autoloaded by Rails if a top level constant already exists with the same name. To avoid clashing with constants defined in users' applications or gems, we can use `require_dependency` to ensure that the nested constants are loaded before they're used.
* | Document MuPDF version requirementGeorge Claghorn2018-02-131-1/+1
| |
* | Add ActiveStorage::Blob.unattached scopefatkodima2018-02-122-0/+19
| |