When running setup/script the above error pops up
https://openfoodnetwork.slack.com/archives/C2GQ45KNU/p1620456501144500?thread_ts=1620397593.134200&cid=C2GQ45KNU
Linked issue: #7613
Timeline: 1 week. Impact: better onboarding experience for new developers ✨
Aha, I've never seen this before. Yeah it looks like a simple error in that sample data file. We just need to drop the distributor: keys from all the items in this array: https://github.com/openfoodfoundation/openfoodnetwork/blob/99cf23df265ea97a1b6485c08d464da3298670b9/lib/tasks/sample_data/product_factory.rb#L23-L28
I can confirm removing the distributor lines fixed it for me when I tried it yesterday, however I thought these lines were needed, since they were added 2 years ago in commit 2019-01-08 4b389ba357, and touched again in 2020-11-02 5289a5b381
Maybe they were a forgotten part of a bigger change, since no one noticed the error they produced in a while.
Also, they don't error if you have already have the db with seeds on your computer, so that is probably why current devs have not noticed it.
they don't error if you have already have the db with seeds on your computer, so that is probably why current devs have not noticed it.
Yep! I think part of the issue is that previous versions of Rails used to silently ignore attributes that were not relevant, but after one of the Rails upgrades the behavior changed to throwing a fatal error instead.
Most helpful comment
Yep! I think part of the issue is that previous versions of Rails used to silently ignore attributes that were not relevant, but after one of the Rails upgrades the behavior changed to throwing a fatal error instead.