{"blog_url":"https://wai-doi.hatenablog.com/","version":"1.0","image_url":null,"author_name":"wai-doi","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/wai-doi/","blog_title":"\u3069\u3044\u30d6\u30ed\u30b0","url":"https://wai-doi.hatenablog.com/entry/2021/03/08/220558","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwai-doi.hatenablog.com%2Fentry%2F2021%2F03%2F08%2F220558\" title=\"FactoryBot 6.0 \u304b\u3089 enum \u306e traits \u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f - \u3069\u3044\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","categories":["Ruby","Rails","Gem"],"description":"\u306f\u3058\u3081\u306b 2020 \u5e74 6 \u6708\u306b\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u3044\u305f FactoryBot \u30d0\u30fc\u30b8\u30e7\u30f3 6.0.0 \u304b\u3089 ActiveModel \u306e enum \u306e\u5217\u6319\u5b50\u3054\u3068\u306b traits \u304c\u81ea\u52d5\u3067\u4f5c\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3064\u3044\u3066\u6280\u8853\u8a18\u4e8b\u304c\u3042\u307e\u308a\u306a\u304b\u3063\u305f\u306e\u3067\u66f8\u3044\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 \u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a status \u3068\u3044\u3046 enum \u306e\u30ab\u30e9\u30e0\u3092\u3082\u3064 Task \u30e2\u30c7\u30eb\u304c\u3042\u308b\u3068\u3057\u307e\u3059\u3002 # app/models/task.rb class Task < ActiveRecord::Base enum status: {queued: 0, started: 1, finished: 2} end v6.\u2026","provider_name":"Hatena Blog","type":"rich","height":"190","title":"FactoryBot 6.0 \u304b\u3089 enum \u306e traits \u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f","published":"2021-03-08 22:05:58"}