Ask A Question


You’re not receiving notifications from this thread.

ActiveStorage Named Variants, Preprocessed Variants, and Representations for File Uploads in Rails Discussion

Hey all, we are using named variants with fixtures to both test and load example data in development. We started getting Foreign key violations found in your fixture data. errors and found we needed to create an empty test/fixtures/active_storage/variant_records.yml file to make sure the active_storage_variant_records table is cleared out properly when reloading the fixture data with rails db:fixtures:load.
Just sharing in case someone else comes across a similar issue.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,038+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.