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

Suggestion: update README to recommend disabling ActiveStorage variant tracking #7

Open
marckohlbrugge opened this issue Feb 13, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@marckohlbrugge
Copy link

Is your feature request related to a problem? Please describe.

When using ActiveStorage's with_attached_*, it will try to eager load any variants in the database as described here:

If ActiveStorage.track_variants is enabled, it will also include the variants record and their attached blobs.

https://edgeapi.rubyonrails.org/classes/ActiveStorage/Attached/Model.html#method-i-with_attached_-2A

This setting is enabled by default.

This leads to unnecessary database calls when using imgproxy-rails, as no variants will be stored in the database anyway.

Describe the solution you'd like

Recommend users, or at least suggest to them, to disable variant tracking if they use imgproxy-rails

config.active_storage.track_variants = false
@marckohlbrugge marckohlbrugge added the enhancement New feature or request label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants