[openstreetmap/openstreetmap-website] Automatically provide a language in diary entries factory (PR #7009)
Tom Hughes
notifications at github.com
Thu Apr 23 17:39:36 UTC 2026
@tomhughes commented on this pull request.
> @@ -5,6 +5,7 @@
sequence(:title) { |n| "Diary entry #{n}" }
sequence(:body) { |n| "This is diary entry #{n}" }
+ language { Language.find_by(:code => "en") || create(:language, :code => "en") }
Personally, and after spending some time hunting through the factorybot documentation assuming that there must be a better way, it seems that @pablobm's original suggestion is probably best.
To be honest I'm struggling to understand how this has been working... Does factorybot really just associate to a random record if you don't tell it to do something else?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7009?email_source=notifications&email_token=AAK2OLJ4Z4ZJJJBCVBQMEDL4XJINRA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMJWGQ2TONJYGM3KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOS6XA4S7OJSXM2LFO5PW433UNFTGSY3BORUW63TTL5RWY2LDNM#discussion_r3132661307
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7009/review/4164575836 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260423/0634ae88/attachment-0001.htm>
More information about the rails-dev
mailing list