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

Include warning in docs about polymorphism in underlying tables #36431

Merged
merged 1 commit into from Jun 6, 2019

Conversation

alexgomez54
Copy link
Contributor

Summary

We had a bug whereby we changed the namespace on a model using ActiveStorage, which resulted in broken download links. The reason this happened is because the active_storage_attachments table is a polymorphic join table that records the model's class name at the time of record creation, and uses this record_type in queries. Since the model namespace changed, the queries did not return the blob as expected. Discussed with @rafaelfranca, who suggested adding a warning about this in the docs.

We had a bug whereby we changed the namespace on a model using ActiveStorage, which resulted in broken download links. The reason this happened is because the `active_storage_attachments` table is a polymorphic join table that records the model's class name at the time of record creation, and uses this `record_type` in queries. Since the model namespace changed, the queries did not return the blob as expected. Discussed with @rafaelfranca, who suggested adding a warning about this in the docs.
@rails-bot rails-bot bot added the docs label Jun 6, 2019
@rafaelfranca rafaelfranca merged commit cb9c1da into rails:master Jun 6, 2019
rafaelfranca added a commit that referenced this pull request Jun 6, 2019
Include warning in docs about polymorphism in underlying tables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants