- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (38)
- 7.1.3.2 (33)
- 7.1.3.4 (0)
- What's this?
Active Storage Service
Abstract class serving as an interface for concrete services.
The available services are:
-
Disk, to manage attachments saved directly on the hard drive.
-
GCS, to manage attachments through Google Cloud Storage.
-
S3, to manage attachments through Amazon S3.
-
AzureStorage, to manage attachments through Microsoft Azure Storage.
-
Mirror, to be able to use several services to manage attachments.
Inside a Rails application, you can set-up your services through the generated config/storage.yml file and reference one of the aforementioned constant under the service key. For example:
local: service: Disk root: <%= Rails.root.join("storage") %>
You can checkout the service’s constructor to know which keys are required.
Then, in your application’s configuration, you can specify the service to use like this:
config.active_storage.service = :local
If you are using Active Storage outside of a Ruby on Rails application, you can configure the service to use like this:
ActiveStorage::Blob.service = ActiveStorage::Service.configure( :local, { local: {service: "Disk", root: Pathname("/tmp/foo/storage") } } )