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

Replace assets config with public_file_server #7111

Merged

Conversation

sauloperez
Copy link
Contributor

What? Why?

This fixes the following deprecation warnings

DEPRECATION WARNING: `config.serve_static_files` is deprecated and will be removed in Rails 5.1.
Please use `config.public_file_server.enabled = true` instead.
 (called from block in <top (required)> at /home/runner/work/openfoodnetwork/openfoodnetwork/config/environments/test.rb:13)
DEPRECATION WARNING: `config.static_cache_control` is deprecated and will be removed in Rails 5.1.
Please use
`config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }`
instead.
 (called from block in <top (required)> at /home/runner/work/openfoodnetwork/openfoodnetwork/config/environments/test.rb:14)

What should we test?

Green build.

Release notes

Replace assets test config with public_file_server
Changelog Category: Technical changes

@sauloperez sauloperez self-assigned this Mar 15, 2021
@Matt-Yorkley
Copy link
Contributor

There are 2 other places where we use config.serve_static_files right?

@sauloperez sauloperez force-pushed the fix-static-assets-deprecation branch from fa59742 to 6aff90a Compare March 16, 2021 14:00
@sauloperez
Copy link
Contributor Author

Right. I pushed-force it.

This fixes the following deprecation warnings

```
DEPRECATION WARNING: `config.serve_static_files` is deprecated and will be removed in Rails 5.1.
Please use `config.public_file_server.enabled = true` instead.
 (called from block in <top (required)> at /home/runner/work/openfoodnetwork/openfoodnetwork/config/environments/test.rb:13)
DEPRECATION WARNING: `config.static_cache_control` is deprecated and will be removed in Rails 5.1.
Please use
`config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }`
instead.
 (called from block in <top (required)> at /home/runner/work/openfoodnetwork/openfoodnetwork/config/environments/test.rb:14)
```
@sauloperez sauloperez force-pushed the fix-static-assets-deprecation branch from 6aff90a to 8c57ccd Compare March 17, 2021 14:43
@sauloperez sauloperez changed the title Replace assets test config with public_file_server Replace assets config with public_file_server Mar 17, 2021
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Great.

@mkllnk mkllnk merged commit 33f7fa7 into openfoodfoundation:master Mar 18, 2021
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.

3 participants