CHANGELOG.md 2.6 KB
Newer Older
1 2 3 4
*   Set content disposition in direct upload using `filename` and `disposition` parameters to `ActiveStorage::Service#headers_for_direct_upload`.

    *Peter Zhu*

5 6 7 8 9
*   Allow record to be optionally passed to blob finders to make sharding
    easier.

    *Gannon McGibbon*

10 11 12 13
*   Switch from `azure-storage` gem to `azure-storage-blob` gem for Azure service.

    *Peter Zhu*

14 15 16 17
*   Add `config.active_storage.draw_routes` to disable Active Storage routes.

    *Gannon McGibbon*

18
*   Image analysis is skipped if ImageMagick returns an error.
19

20 21 22 23
    `ActiveStorage::Analyzer::ImageAnalyzer#metadata` would previously raise a
    `MiniMagick::Error`, which caused persistent `ActiveStorage::AnalyzeJob`
    failures. It now logs the error and returns `{}`, resulting in no metadata
    being added to the offending image blob.
24

25
    *George Claghorn*
26

27
*   Method calls on singular attachments return `nil` when no file is attached.
28

29 30
    Previously, assuming the following User model, `user.avatar.filename` would
    raise a `Module::DelegationError` if no avatar was attached:
31

32 33 34 35 36
    ```ruby
    class User < ApplicationRecord
      has_one_attached :avatar
    end
    ```
37

38
    They now return `nil`.
39

40
    *Matthew Tanous*
41

42
*   The mirror service supports direct uploads.
G
George Claghorn 已提交
43

44 45 46
    New files are directly uploaded to the primary service. When a
    directly-uploaded file is attached to a record, a background job is enqueued
    to copy it to each secondary service.
G
George Claghorn 已提交
47

48 49
    Configure the queue used to process mirroring jobs by setting
    `config.active_storage.queues.mirror`. The default is `:active_storage_mirror`.
G
George Claghorn 已提交
50

51
    *George Claghorn*
G
George Claghorn 已提交
52

53
*   The S3 service now permits uploading files larger than 5 gigabytes.
54

55 56 57
    When uploading a file greater than 100 megabytes in size, the service
    transparently switches to [multipart uploads](https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html)
    using a part size computed from the file's total size and S3's part count limit.
58

59 60 61
    No application changes are necessary to take advantage of this feature. You
    can customize the default 100 MB multipart upload threshold in your S3
    service's configuration:
62

63 64 65 66 67 68 69 70 71 72 73 74
    ```yaml
    production:
      service: s3
      access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
      secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
      region: us-east-1
      bucket: my-bucket
      upload:
        multipart_threshold: <%= 250.megabytes %>
    ```

    *George Claghorn*
75

76

77
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/activestorage/CHANGELOG.md) for previous changes.