{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fomiend.hatenablog.jp%2Fentry%2F2018%2F10%2F14%2F220735\" title=\"FactoryBot\u3067association\u30a2\u30ea\u306e\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3057\u305f\u6642\u3001\u300cActiveModel::MissingAttributeError: can&#39;t write unknown attribute `fk_XXXXXXXX`\u300d\u3068\u3044\u3063\u305f\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u4ef6\u306b\u3064\u3044\u3066 - the industrial\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","type":"rich","url":"https://omiend.hatenablog.jp/entry/2018/10/14/220735","description":"\u30bf\u30a4\u30c8\u30eb\u3060\u3051\u3060\u3068\u4f55\u3044\u3063\u3066\u3093\u3060\u304b\u5168\u7136\u308f\u304b\u3089\u3093\u3067\u3059\u306d\u7b11 \u3061\u3087\u3063\u3068\u56f0\u3063\u3066\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3053\u3093\u306aModel\u304c\u3042\u3063\u305f\u3068\u3057\u3066 app/models/Employee.rb class Employee < ActiveRecord::Base # \u4e0a\u53f8 belongs_to :boss, foreign_key: 'fk_employee_to_boss', optional: true end \u203b\u3064\u307e\u308a\u306f\u81ea\u5df1\u7d50\u5408 Active Record \u306e\u95a2\u9023\u4ed8\u3051 (\u30a2\u30bd\u30b7\u30a8\u30fc\u30b7\u30e7\u30f3) | Rails \u30ac\u30a4\u30c9 FactoryBot\u3067\u3053\u3093\u306a\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057 spec/factories/Employees.rb Fact\u2026","width":"100%","blog_title":"the industrial","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","version":"1.0","title":"FactoryBot\u3067association\u30a2\u30ea\u306e\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3057\u305f\u6642\u3001\u300cActiveModel::MissingAttributeError: can't write unknown attribute `fk_XXXXXXXX`\u300d\u3068\u3044\u3063\u305f\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u4ef6\u306b\u3064\u3044\u3066","author_name":"omiend","author_url":"https://blog.hatena.ne.jp/omiend/","published":"2018-10-14 22:07:35","blog_url":"https://omiend.hatenablog.jp/","categories":["Rails","RubyOnRails","Ruby","FactoryBot"],"image_url":null}