CHANGELOG.md 6.3 KB
Newer Older
G
v6.0.1  
George Claghorn 已提交
1
## Rails 6.0.1 (November 5, 2019) ##
G
George Claghorn 已提交
2 3 4 5 6 7 8 9 10 11 12 13

*   `ActiveStorage::AnalyzeJob`s are discarded on `ActiveRecord::RecordNotFound` errors.

    *George Claghorn*

*   Blobs are recorded in the database before being uploaded to the service.
    This fixes that generated blob keys could silently collide, leading to
    data loss.

    *Julik Tarkhanov*


14 15 16 17 18
## Rails 6.0.0 (August 16, 2019) ##

*   No changes.


19 20 21 22 23
## Rails 6.0.0.rc2 (July 22, 2019) ##

*   No changes.


24 25
## Rails 6.0.0.rc1 (April 24, 2019) ##

26 27 28
*   Don't raise when analyzing an image whose type is unsupported by ImageMagick.

    Fixes #36065.
29 30 31

    *Guilherme Mansur*

32 33 34 35
*   Permit generating variants of BMP images.

    *Younes Serraj*

36

E
eileencodes 已提交
37 38 39 40 41
## Rails 6.0.0.beta3 (March 11, 2019) ##

*   No changes.


42 43 44 45 46
## Rails 6.0.0.beta2 (February 25, 2019) ##

*   No changes.


47 48
## Rails 6.0.0.beta1 (January 18, 2019) ##

49 50 51 52 53 54
*   [Rename npm package](https://github.com/rails/rails/pull/34905) from
    [`activestorage`](https://www.npmjs.com/package/activestorage) to
    [`@rails/activestorage`](https://www.npmjs.com/package/@rails/activestorage).

    *Javan Makhmali*

55 56 57 58 59 60 61 62 63 64 65
*   Replace `config.active_storage.queue` with two options that indicate which
    queues analysis and purge jobs should use, respectively:

    * `config.active_storage.queues.analysis`
    * `config.active_storage.queues.purge`

    `config.active_storage.queue` is preferred over the new options when it's
    set, but it is deprecated and will be removed in Rails 6.1.

    *George Claghorn*

66 67 68 69
*   Permit generating variants of TIFF images.

    *Luciano Sousa*

70 71 72 73 74 75
*   Use base36 (all lowercase) for all new Blob keys to prevent
    collisions and undefined behavior with case-insensitive filesystems and
    database indices.

    *Julik Tarkhanov*

76 77 78 79 80
*   It doesn’t include an `X-CSRF-Token` header if a meta tag is not found on
    the page. It previously included one with a value of `undefined`.

    *Cameron Bothner*

81 82 83 84
*   Fix `ArgumentError` when uploading to amazon s3

    *Hiroki Sanpei*

85 86 87 88
*   Add progressive JPG to default list of variable content types

    *Maurice Kühlborn*

89 90 91 92
*   Add `ActiveStorage.routes_prefix` for configuring generated routes.

    *Chris Bisnett*

93 94 95 96 97 98 99
*   `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*

100 101 102 103 104 105
*   `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*

106 107 108 109 110 111 112 113 114
*   `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*

115 116 117 118 119
*   Added the `ActiveStorage::SetCurrent` concern for custom Active Storage
    controllers that can't inherit from `ActiveStorage::BaseController`.

    *George Claghorn*

120 121 122 123 124 125 126
*   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*

127 128 129 130 131 132 133 134 135 136 137 138 139 140
*   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*

K
Kevin Deisz 已提交
141 142 143 144 145
*   Add the ability to reflect on defined attachments using the existing
    ActiveRecord reflection mechanism.

    *Kevin Deisz*

146 147 148 149 150 151 152 153 154 155
*   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*

156 157 158 159 160 161
*   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*

G
George Claghorn 已提交
162 163 164
*   Add `ActiveStorage::Blob#open`, which downloads a blob to a tempfile on disk
    and yields the tempfile. Deprecate `ActiveStorage::Downloading`.

165
    *David Robertson*, *George Claghorn*
G
George Claghorn 已提交
166

167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
*   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*

182 183 184 185 186
*   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*

J
Janko Marohnić 已提交
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
*   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ć*

K
Kasper Timm Hansen 已提交
206
*   Rails 6 requires Ruby 2.5.0 or newer.
J
Jeremy Daer 已提交
207

K
Kasper Timm Hansen 已提交
208
    *Jeremy Daer*, *Kasper Timm Hansen*
J
Jeremy Daer 已提交
209 210


211
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/activestorage/CHANGELOG.md) for previous changes.