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

Make active-storage configurable #4152

merged 1 commit into from
Jun 1, 2020

Conversation

phuongdh
Copy link
Member

@phuongdh phuongdh commented Jun 1, 2020

Fixes #4114

@@ -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 == :""

Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Is there any difference between application and environment here? Maybe load order?

@phuongdh
Copy link
Member Author

phuongdh commented Jun 1, 2020

Looks fine to me. Is there any difference between application and environment here? Maybe load order?

I pulled it out of development.rb because all environments (test is debatable) need to be configurable to fit different setup.

@phuongdh phuongdh merged commit ee6294d into develop Jun 1, 2020
@cjcolvar cjcolvar deleted the as-config branch June 1, 2020 20:13
@joncameron joncameron mentioned this pull request Jun 9, 2020
22 tasks
@Dananji Dananji mentioned this pull request Oct 14, 2020
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants