2018-11-28 03:06:29 -05:00
|
|
|
|
* Fix `ArgumentError` when uploading to amazon s3
|
|
|
|
|
|
|
|
|
|
*Hiroki Sanpei*
|
|
|
|
|
|
2018-11-15 06:11:36 -05:00
|
|
|
|
* Add progressive JPG to default list of variable content types
|
|
|
|
|
|
|
|
|
|
*Maurice Kühlborn*
|
|
|
|
|
|
2018-09-14 10:23:32 -04:00
|
|
|
|
* Add `ActiveStorage.routes_prefix` for configuring generated routes.
|
|
|
|
|
|
|
|
|
|
*Chris Bisnett*
|
|
|
|
|
|
2018-08-23 23:36:43 -04:00
|
|
|
|
* `ActiveStorage::Service::AzureStorageService` only handles specifically
|
|
|
|
|
relevant types of `Azure::Core::Http::HTTPError`. It previously obscured
|
|
|
|
|
other types of `HTTPError`, which is the azure-storage gem’s catch-all
|
|
|
|
|
exception class.
|
|
|
|
|
|
|
|
|
|
*Cameron Bothner*
|
|
|
|
|
|
2018-08-18 14:03:52 -04:00
|
|
|
|
* `ActiveStorage::DiskController#show` generates a 404 Not Found response when
|
|
|
|
|
the requested file is missing from the disk service. It previously raised
|
|
|
|
|
`Errno::ENOENT`.
|
|
|
|
|
|
|
|
|
|
*Cameron Bothner*
|
|
|
|
|
|
2018-08-18 13:31:33 -04:00
|
|
|
|
* `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`.
|
|
|
|
|
|
|
|
|
|
*Cameron Bothner*
|
|
|
|
|
|
2018-08-16 01:41:15 -04:00
|
|
|
|
* Added the `ActiveStorage::SetCurrent` concern for custom Active Storage
|
|
|
|
|
controllers that can't inherit from `ActiveStorage::BaseController`.
|
|
|
|
|
|
|
|
|
|
*George Claghorn*
|
|
|
|
|
|
2018-08-10 18:35:49 -04:00
|
|
|
|
* Active Storage error classes like `ActiveStorage::IntegrityError` and
|
|
|
|
|
`ActiveStorage::UnrepresentableError` now inherit from `ActiveStorage::Error`
|
|
|
|
|
instead of `StandardError`. This permits rescuing `ActiveStorage::Error` to
|
|
|
|
|
handle all Active Storage errors.
|
|
|
|
|
|
|
|
|
|
*Andrei Makarov*, *George Claghorn*
|
|
|
|
|
|
2018-07-07 23:25:33 -04:00
|
|
|
|
* Uploaded files assigned to a record are persisted to storage when the record
|
|
|
|
|
is saved instead of immediately.
|
|
|
|
|
|
|
|
|
|
In Rails 5.2, the following causes an uploaded file in `params[:avatar]` to
|
|
|
|
|
be stored:
|
|
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
|
@user.avatar = params[:avatar]
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
In Rails 6, the uploaded file is stored when `@user` is successfully saved.
|
|
|
|
|
|
|
|
|
|
*George Claghorn*
|
|
|
|
|
|
2018-05-29 15:57:56 -04:00
|
|
|
|
* Add the ability to reflect on defined attachments using the existing
|
|
|
|
|
ActiveRecord reflection mechanism.
|
|
|
|
|
|
|
|
|
|
*Kevin Deisz*
|
|
|
|
|
|
Disable variant options when false or nil present
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
2018-05-19 22:14:57 -04:00
|
|
|
|
* Variant arguments of `false` or `nil` will no longer be passed to the
|
|
|
|
|
processor. For example, the following will not have the monochrome
|
|
|
|
|
variation applied:
|
|
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
|
avatar.variant(monochrome: false)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
*Jacob Smith*
|
|
|
|
|
|
2018-05-17 17:22:00 -04:00
|
|
|
|
* Generated attachment getter and setter methods are created
|
|
|
|
|
within the model's `GeneratedAssociationMethods` module to
|
|
|
|
|
allow overriding and composition using `super`.
|
|
|
|
|
|
|
|
|
|
*Josh Susser*, *Jamon Douglas*
|
|
|
|
|
|
2018-05-16 22:12:31 -04:00
|
|
|
|
* Add `ActiveStorage::Blob#open`, which downloads a blob to a tempfile on disk
|
|
|
|
|
and yields the tempfile. Deprecate `ActiveStorage::Downloading`.
|
|
|
|
|
|
2018-05-17 08:01:11 -04:00
|
|
|
|
*David Robertson*, *George Claghorn*
|
2018-05-16 22:12:31 -04:00
|
|
|
|
|
2018-05-06 11:25:05 -04:00
|
|
|
|
* Pass in `identify: false` as an argument when providing a `content_type` for
|
|
|
|
|
`ActiveStorage::Attached::{One,Many}#attach` to bypass automatic content
|
|
|
|
|
type inference. For example:
|
|
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
|
@message.image.attach(
|
|
|
|
|
io: File.open('/path/to/file'),
|
|
|
|
|
filename: 'file.pdf',
|
|
|
|
|
content_type: 'application/pdf',
|
|
|
|
|
identify: false
|
|
|
|
|
)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
*Ryan Davidson*
|
|
|
|
|
|
2018-05-01 23:20:56 -04:00
|
|
|
|
* The Google Cloud Storage service properly supports streaming downloads.
|
|
|
|
|
It now requires version 1.11 or newer of the google-cloud-storage gem.
|
|
|
|
|
|
|
|
|
|
*George Claghorn*
|
|
|
|
|
|
2018-04-23 15:27:28 -04:00
|
|
|
|
* Use the [ImageProcessing](https://github.com/janko-m/image_processing) gem
|
|
|
|
|
for Active Storage variants, and deprecate the MiniMagick backend.
|
|
|
|
|
|
|
|
|
|
This means that variants are now automatically oriented if the original
|
|
|
|
|
image was rotated. Also, in addition to the existing ImageMagick
|
|
|
|
|
operations, variants can now use `:resize_to_fit`, `:resize_to_fill`, and
|
|
|
|
|
other ImageProcessing macros. These are now recommended over raw `:resize`,
|
|
|
|
|
as they also sharpen the thumbnail after resizing.
|
|
|
|
|
|
|
|
|
|
The ImageProcessing gem also comes with a backend implemented on
|
|
|
|
|
[libvips](http://jcupitt.github.io/libvips/), an alternative to
|
|
|
|
|
ImageMagick which has significantly better performance than
|
|
|
|
|
ImageMagick in most cases, both in terms of speed and memory usage. In
|
|
|
|
|
Active Storage it's now possible to switch to the libvips backend by
|
|
|
|
|
changing `Rails.application.config.active_storage.variant_processor` to
|
|
|
|
|
`:vips`.
|
|
|
|
|
|
|
|
|
|
*Janko Marohnić*
|
|
|
|
|
|
2018-02-17 16:02:18 -05:00
|
|
|
|
* Rails 6 requires Ruby 2.4.1 or newer.
|
|
|
|
|
|
|
|
|
|
*Jeremy Daer*
|
|
|
|
|
|
|
|
|
|
|
2018-01-30 18:51:17 -05:00
|
|
|
|
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/activestorage/CHANGELOG.md) for previous changes.
|