Support per-environment ASt service config
This commit is contained in:
parent
57bd5f0df8
commit
1e2cd7a75e
|
@ -1,3 +1,7 @@
|
||||||
|
* Add per-environment configuration support
|
||||||
|
|
||||||
|
*Pietro Moro*
|
||||||
|
|
||||||
* The Poppler PDF previewer renders a preview image using the original
|
* The Poppler PDF previewer renders a preview image using the original
|
||||||
document's crop box rather than its media box, hiding print margins. This
|
document's crop box rather than its media box, hiding print margins. This
|
||||||
matches the behavior of the MuPDF previewer.
|
matches the behavior of the MuPDF previewer.
|
||||||
|
|
|
@ -116,7 +116,8 @@ module ActiveStorage
|
||||||
ActiveSupport.on_load(:active_storage_blob) do
|
ActiveSupport.on_load(:active_storage_blob) do
|
||||||
configs = Rails.configuration.active_storage.service_configurations ||=
|
configs = Rails.configuration.active_storage.service_configurations ||=
|
||||||
begin
|
begin
|
||||||
config_file = Rails.root.join("config/storage.yml")
|
config_file = Rails.root.join("config/storage/#{Rails.env}.yml")
|
||||||
|
config_file = Rails.root.join("config/storage.yml") unless config_file.exist?
|
||||||
raise("Couldn't find Active Storage configuration in #{config_file}") unless config_file.exist?
|
raise("Couldn't find Active Storage configuration in #{config_file}") unless config_file.exist?
|
||||||
|
|
||||||
ActiveSupport::ConfigurationFile.parse(config_file)
|
ActiveSupport::ConfigurationFile.parse(config_file)
|
||||||
|
|
|
@ -97,6 +97,10 @@ config.active_storage.service = :test
|
||||||
Continue reading for more information on the built-in service adapters (e.g.
|
Continue reading for more information on the built-in service adapters (e.g.
|
||||||
`Disk` and `S3`) and the configuration they require.
|
`Disk` and `S3`) and the configuration they require.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
### Disk Service
|
### Disk Service
|
||||||
|
|
||||||
Declare a Disk service in `config/storage.yml`:
|
Declare a Disk service in `config/storage.yml`:
|
||||||
|
|
Loading…
Reference in New Issue