aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_storage_overview.md
diff options
context:
space:
mode:
authorJeffrey Guenther <guenther.jeffrey@gmail.com>2017-12-08 13:44:59 -0800
committerJeffrey Guenther <guenther.jeffrey@gmail.com>2017-12-08 13:44:59 -0800
commitab2a95db8088b7607017671b82e396bcd9e80332 (patch)
tree9711c48418b7e8d5d68ccd9e02289238de0a1789 /guides/source/active_storage_overview.md
parenta822287cefc38b9b8b3be38ffd775cd3d511b7c3 (diff)
downloadrails-ab2a95db8088b7607017671b82e396bcd9e80332.tar.gz
rails-ab2a95db8088b7607017671b82e396bcd9e80332.tar.bz2
rails-ab2a95db8088b7607017671b82e396bcd9e80332.zip
Apply edits and suggestions
Diffstat (limited to 'guides/source/active_storage_overview.md')
-rw-r--r--guides/source/active_storage_overview.md39
1 files changed, 19 insertions, 20 deletions
diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md
index d28a67b150..5027d3acf4 100644
--- a/guides/source/active_storage_overview.md
+++ b/guides/source/active_storage_overview.md
@@ -86,16 +86,6 @@ config.active_storage.service = :s3
Continue reading for more information on the built-in service adapters (e.g.
`Disk` and `S3`) and the configuration they require.
-Mirrored services can be used to facilitate a migration between services in
-production. You can start mirroring to the new service, copy existing files from
-the old service to the new, then go all-in on the new service.
-
-If you wish to transform your images, add `mini_magick` to your Gemfile:
-
-``` ruby
-gem 'mini_magick'
-```
-
### Disk Service
Declare a Disk service in `config/storage.yml`:
@@ -169,10 +159,13 @@ gem "google-cloud-storage", "~> 1.3", require: false
### Mirror Service
-You can keep multiple services in sync by defining a mirror service. When
-a file is uploaded or deleted, it's done across all the mirrored services.
-Define each of the services you'd like to use as described above and reference
-them from a mirrored service.
+You can keep multiple services in sync by defining a mirror service. When a file
+is uploaded or deleted, it's done across all the mirrored services. Mirrored
+services can be used to facilitate a migration between services in production.
+You can start mirroring to the new service, copy existing files from the old
+service to the new, then go all-in on the new service. Define each of the
+services you'd like to use as described above and reference them from a mirrored
+service.
``` yaml
s3_west_coast:
@@ -280,7 +273,7 @@ Call `images.attach` to add new images to an existing message:
@message.images.attach(params[:images])
```
-Call `images.attached?`` to determine whether a particular message has any images:
+Call `images.attached?` to determine whether a particular message has any images:
```ruby
@message.images.attached?
@@ -327,7 +320,13 @@ Create Variations of Attached Image
Sometimes your application requires images in a different format than
what was uploaded. To create variation of the image, call `variant` on the Blob.
You can pass any [MiniMagick](https://github.com/minimagick/minimagick)
-supported transformation.
+supported transformation to the method.
+
+To enable variants, add `mini_magick` to your Gemfile:
+
+``` ruby
+gem 'mini_magick'
+```
When the browser hits the variant URL, ActiveStorage will lazy transform the
original blob into the format you specified and redirect to its new service
@@ -520,7 +519,7 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
end
```
-If your system tests verify the deletion of a model with attachments and your
+If your system tests verify the deletion of a model with attachments and you're
using Active Job, set your test environment to use the inline queue adapter so
the purge job is executed immediately rather at an unknown time in the future.
@@ -535,10 +534,10 @@ config.active_job.queue_adapter = :inline
config.active_storage.service = :local_test
```
-Add Support Additional Cloud Service
+Add Support for Additional Cloud Services
------------------------------------
-If you need to support a cloud service other these, you will need to implement
-the Service. Each service extends
+If you need to support a cloud service other than these, you will need to
+implement the Service. Each service extends
[`ActiveStorage::Service`](https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service.rb)
by implementing the methods necessary to upload and download files to the cloud.