Skip to content

Commit

Permalink
Merge pull request #42262 from zzak/zzak/42186
Browse files Browse the repository at this point in the history
Active Storage: Encourage `Rails.env` in bucket names Part 2
  • Loading branch information
zzak committed May 26, 2021
2 parents 328113b + 333356c commit 93e7343
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions guides/source/active_storage_overview.md
Expand Up @@ -101,6 +101,25 @@ NOTE: Configuration files that are environment-specific will take precedence:
in production, for example, the `config/storage/production.yml` file (if existent)
will take precedence over the `config/storage.yml` file.

It is recommended to use `Rails.env` in the bucket names to further reduce the risk of accidentally destroying production data.

```yaml
amazon:
service: S3
# ...
bucket: your_own_bucket-<%= Rails.env %>

google:
service: GCS
# ...
bucket: your_own_bucket-<%= Rails.env %>

azure:
service: AzureStorage
# ...
container: your_container_name-<%= Rails.env %>
```

### Disk Service

Declare a Disk service in `config/storage.yml`:
Expand Down

0 comments on commit 93e7343

Please sign in to comment.