Configure Active Storage

This commit is contained in:
Javi Martín
2021-07-25 22:24:29 +02:00
parent 66ef345a2d
commit 73a0a21001
5 changed files with 15 additions and 1 deletions

1
.gitignore vendored
View File

@@ -40,3 +40,4 @@ public/assets/
public/machine_learning/data/ public/machine_learning/data/
public/system/ public/system/
/public/ckeditor_assets/ /public/ckeditor_assets/
storage/

View File

@@ -24,6 +24,9 @@ module Consul
# Handle custom exceptions # Handle custom exceptions
config.action_dispatch.rescue_responses["FeatureFlags::FeatureDisabled"] = :forbidden config.action_dispatch.rescue_responses["FeatureFlags::FeatureDisabled"] = :forbidden
# Store files locally.
config.active_storage.service = :local
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)' # config.time_zone = 'Central Time (US & Canada)'

View File

@@ -22,7 +22,7 @@ set :pty, true
set :use_sudo, false set :use_sudo, false
set :linked_files, %w[config/database.yml config/secrets.yml] set :linked_files, %w[config/database.yml config/secrets.yml]
set :linked_dirs, %w[.bundle log tmp public/system public/assets public/ckeditor_assets public/machine_learning/data] set :linked_dirs, %w[.bundle log tmp public/system public/assets public/ckeditor_assets public/machine_learning/data storage]
set :keep_releases, 5 set :keep_releases, 5

View File

@@ -47,6 +47,9 @@ Rails.application.configure do
# Raises error for missing translations # Raises error for missing translations
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true
# Store files in tmp folders.
config.active_storage.service = :test
config.cache_store = :null_store config.cache_store = :null_store
config.after_initialize do config.after_initialize do

7
config/storage.yml Normal file
View File

@@ -0,0 +1,7 @@
local:
service: Disk
root: <%= Rails.root.join("storage") %>
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>