Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make active-storage configurable #4152

Merged
merged 1 commit into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ class Application < Rails::Application
resource '/timelines/*/manifest.json', headers: :any, methods: [:get, :post]
end
end

config.active_storage.service = (Settings&.active_storage&.service.presence || "local").to_sym
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious what does .presence do here?

Copy link
Member Author

@phuongdh phuongdh Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presence returns nil when it's an empty string, since ("" || "local").to_sym == :""

end
end
2 changes: 0 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,4 @@
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker

config.active_storage.service = :minio
end
3 changes: 2 additions & 1 deletion config/settings/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ timeliner:
timeliner_url: http://localhost:3000/timeliner
supplemental_files:
proxy: true

active_storage:
service: :minio