{"id":9687,"date":"2020-03-15T06:39:23","date_gmt":"2020-03-14T21:39:23","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=9687"},"modified":"2023-05-27T22:28:30","modified_gmt":"2023-05-27T13:28:30","slug":"%e3%80%90rspec%e3%80%91%e3%80%8cfactorybot%e3%80%8d%e3%81%ae%e6%a7%8b%e6%96%87%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=9687","title":{"rendered":"\u3010Rspec\u3011\u300cFactoryBot\u300d\u306e\u69cb\u6587\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5074<\/h2>\n<h3>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306b\u9023\u756a\u3092\u3064\u3051\u308b\u3002(\u30b7\u30fc\u30b1\u30f3\u30b9\uff09<\/h3>\n<p>\u901a\u5e38\u306f\u3001FactoryBot.create\u3084FactoryBot.build\u3092<span style=\"color: #ff0000;\"><strong>\u8907\u6570\u56de\u5b9f\u884c\u3057\u305f\u5834\u5408\u306f\u5e38\u306b\u540c\u3058\u30c7\u30fc\u30bf\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306bsequence\u3092\u4f7f\u3046\u3053\u3068\u3067\u8907\u6570\u56de\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u305f\u969b\u306b\u9023\u756a\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">FactoryBot.define do\r\n  factory :\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u540d do\r\n    sequence(:\u30ab\u30e9\u30e0\u540d) { |n| \"\u3053\u3053\u306b#{n}\u9023\u756a\u3092\u633f\u5165\" }\r\n  end\r\nend<\/pre>\n<p>\u7d76\u5bfe\u306b\u8907\u6570\u30c7\u30fc\u30bf\u3092\u4f7f\u3046\u3068\u308f\u304b\u3063\u3066\u3044\u308b\u30ab\u30e9\u30e0\u7b49\u306b\u95a2\u3057\u3066\u306f\u4e0a\u8a18\u306e\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u3068Rspec\u306e\u8a18\u8ff0\u3082\u3059\u3063\u304d\u308a\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30e2\u30c7\u30eb\u540c\u58eb\u3092\u95a2\u9023\u3065\u3051\u3066\u30c7\u30fc\u30bf\u3092\u751f\u6210\u3059\u308b\u3002<\/h3>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3068FactoryBot.create\u3092\u5b9f\u884c\u3059\u308b\u3068\u540c\u6642\u306b\u6240\u5c5e\u3059\u308b\u30e2\u30c7\u30eb\u307e\u3067\u81ea\u52d5\u3067\u751f\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u3044\u3061\u3044\u3061\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u5074\u3067\u95a2\u9023\u3059\u308b\u30e2\u30c7\u30eb\u306e\u751f\u6210\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u306a\u304f\u3066\u3088\u304f\u306a\u308a\u307e\u3059\u3002<\/strong><\/span><\/p>\n<pre class=\"lang:default decode:true \">FactoryBot.define do\r\n  factory :\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u540d do\r\n    association :\u672c\u30e2\u30c7\u30eb\u304c\u6240\u5c5e\u3059\u308b\u30e2\u30c7\u30eb\u540d\r\n  end\r\nend<\/pre>\n<h3>\u5225\u540d\u3092\u3064\u3051\u308b\u3002<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u30e2\u30c7\u30eb\u5074\uff08app\/models\/\u30e2\u30c7\u30eb\u540d.rb\uff09\u3067\u30e2\u30c7\u30eb\u3092\u5225\u540d\u3067\u53c2\u7167\u3059\u308b\u3088\u3046\u306a\u30bd\u30fc\u30b9\u306b\u306a\u3063\u3066\u3044\u305f\u5834\u5408<\/strong><\/span>\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u3066\u30e2\u30c7\u30eb\u306e\u4ed5\u69d8\u306b\u5408\u308f\u305b\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">FactoryBot.define do\r\n  factory :user, aliases: [:\u5225\u540d] do\r\n  end\r\nend<\/pre>\n<h3>\u8907\u6570\u30d5\u30a1\u30af\u30c8\u30ea\u3092\u4f5c\u308b\u3002<\/h3>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308c\u3070\u30d5\u30a1\u30af\u30c8\u30ea\u3092\u8907\u6570\u4f5c\u6210\u3057\u3066\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u5185\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">FactoryBot.define do\r\n  factory :\u30d5\u30a1\u30af\u30c8\u30ea\u540d do\r\n    \u5c5e\u60271: \u5c5e\u6027\u50241\r\n    \u5c5e\u60272: \u5c5e\u6027\u50242\r\n  end\r\n\r\n  factory :\u30d5\u30a1\u30af\u30c8\u30ea1,class: \u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u540d(User\u7b49) do\r\n    \u5c5e\u60271: \u5c5e\u6027\u50241\r\n    \u5c5e\u60272: \u5c5e\u6027\u50242\r\n  end\r\n\r\n  factory :\u30d5\u30a1\u30af\u30c8\u30ea2,class: \u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u540d(User\u7b49) do\r\n    \u5c5e\u60271: \u5c5e\u6027\u50241\r\n    \u5c5e\u60272: \u5c5e\u6027\u50242\r\n  end\r\n\r\n  factory :\u30d5\u30a1\u30af\u30c8\u30ea3,class: \u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u540d(User\u7b49) do\r\n    \u5c5e\u60271: \u5c5e\u6027\u50241\r\n    \u5c5e\u60272: \u5c5e\u6027\u50242\r\n  end\r\nend<\/pre>\n<h3>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u91cd\u8907\u3092\u6392\u9664\u3059\u308b\u3002<\/h3>\n<h4>\u7d99\u627f\u306b\u3088\u308b\u91cd\u8907\u6392\u9664<\/h4>\n<h5>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5074\u306e\u8a18\u8ff0\u65b9\u6cd5<\/h5>\n<p>\u4e0a\u306e\u30b3\u30fc\u30c9\u3060\u3068FactoryBot\u306e\u8a18\u8ff0\u304c\u304b\u306a\u308a\u5197\u9577\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308c\u3070\u3059\u3063\u304d\u308a\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002\u69cb\u9020\u304b\u3089\u4f7f\u3046\u30af\u30e9\u30b9\u304c\u308f\u304b\u308b\u305f\u3081class\u6307\u5b9a\u3082\u5fc5\u8981\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">FactoryBot.define do\r\n  factory :\u89aa\u30d5\u30a1\u30af\u30c8\u30ea\u540d do\r\n    \u5c5e\u60271: \u5c5e\u6027\u50241\uff08\u5b50\u30d5\u30a1\u30af\u30c8\u30ea\u306b\u3082\u7d99\u627f\u3055\u308c\u308b\uff09\r\n    \u5c5e\u60272: \u5c5e\u6027\u50242\uff08\u5b50\u30d5\u30a1\u30af\u30c8\u30ea\u306b\u3082\u7d99\u627f\u3055\u308c\u308b\uff09\r\n\r\n    factory :\u5b50\u30d5\u30a1\u30af\u30c8\u30ea1 do\r\n     \u5c5e\u60272': \u5c5e\u6027\u50242'\uff08\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\uff09\r\n    end\r\n\r\n    factory :\u5b50\u30d5\u30a1\u30af\u30c8\u30ea2 do\r\n      \u5c5e\u60272': \u5c5e\u6027\u50242'\uff08\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\uff09\r\n    end\r\n\r\n    factory :\u5b50\u30d5\u30a1\u30af\u30c8\u30ea3 do\r\n      \u5c5e\u60272': \u5c5e\u6027\u50242'\uff08\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\uff09\r\n    end\r\n  end\r\n\r\nend<\/pre>\n<h5>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u5074\u306e\u8a18\u8ff0\u65b9\u6cd5<\/h5>\n<pre class=\"lang:default decode:true \">FactoryBot.create(:\u5b50\u30d5\u30a1\u30af\u30c8\u30ea1)<\/pre>\n<h4>\u30c8\u30ec\u30a4\u30c8(trait)\u3092\u4f7f\u3063\u305f\u91cd\u8907\u6392\u9664<\/h4>\n<h5>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5074\u306e\u8a18\u8ff0\u65b9\u6cd5<\/h5>\n<pre class=\"lang:default decode:true\">FactoryBot.define do\r\n  factory :\u89aa\u30d5\u30a1\u30af\u30c8\u30ea\u540d do\r\n    \u5c5e\u60271: \u5c5e\u6027\u50241\uff08\u5b50\u30d5\u30a1\u30af\u30c8\u30ea\u306b\u3082\u7d99\u627f\u3055\u308c\u308b\uff09\r\n    \u5c5e\u60272: \u5c5e\u6027\u50242\uff08\u5b50\u30d5\u30a1\u30af\u30c8\u30ea\u306b\u3082\u7d99\u627f\u3055\u308c\u308b\uff09\r\n\r\n    trait :\u5b50\u30d5\u30a1\u30af\u30c8\u30ea1 do\r\n     \u5c5e\u60272': \u5c5e\u6027\u50242'\uff08\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\uff09\r\n    end\r\n\r\n    trait :\u5b50\u30d5\u30a1\u30af\u30c8\u30ea2 do\r\n      \u5c5e\u60272': \u5c5e\u6027\u50242'\uff08\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\uff09\r\n    end\r\n\r\n    trait :\u5b50\u30d5\u30a1\u30af\u30c8\u30ea3 do\r\n      \u5c5e\u60272': \u5c5e\u6027\u50242'\uff08\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\uff09\r\n    end\r\n  end\r\n\r\nend<\/pre>\n<h5>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u5074\u306e\u8a18\u8ff0\u65b9\u6cd5<\/h5>\n<p>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u5074\u306e\u8a18\u8ff0\u304c\u7d99\u627f\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u6bd4\u3079\u3066\u5c11\u3057\u5909\u308f\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">FactoryBot.create(:\u30e2\u30c7\u30eb\u540d,:\u5b50\u30d5\u30a1\u30af\u30c8\u30ea1)<\/pre>\n<h4>\u7d99\u627f\u3068\u30c8\u30ec\u30a4\u30c8\u306e\u9055\u3044<\/h4>\n<ul>\n<li>\u30c8\u30ec\u30a4\u30c8\u540c\u58eb\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u8907\u96d1\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u69cb\u7bc9\u3067\u304d\u308b\u70b9(<span style=\"color: #ff0000;\"><strong>\u7d99\u627f\u3067\u306f\u3067\u304d\u306a\u3044<\/strong><\/span>)<\/li>\n<\/ul>\n<h3 class=\"p1\"><b>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af<\/b><\/h3>\n<p class=\"p3\">FactoryBot\u3067create\u3001build\u3001stub\u3059\u308b\u524d\u3084\u3057\u305f\u5f8c\u306b\u8ffd\u52a0\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<h4 class=\"p3\">\u30e1\u30ea\u30c3\u30c8<\/h4>\n<ul>\n<li class=\"p4\">\u9069\u5207\u306b\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u3063\u3066\u8907\u96d1\u306a\u30c6\u30b9\u30c8\u30b7\u30ca\u30ea\u30aa\u3082\u7c21\u5358\u306b\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308b\u3002<\/li>\n<li>\u30e2\u30c7\u30eb\u304c\u5165\u308c\u5b50\u306b\u306a\u3063\u3066\u304a\u308a\u4ed6\u306e\u30e2\u30c7\u30eb\u306e\u5c5e\u6027\u3092\u6301\u3063\u3066\u3044\u308b\u5834\u5408\u3068\u304b\u306e\u30c7\u30fc\u30bf\u4f5c\u6210\u306b\u4f7f\u3048\u307e\u3059\u3002<\/li>\n<\/ul>\n<h4>\u4f8b<\/h4>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308c\u3070FactoryBot.create\u3092\u5b9f\u884c\u3057\u305f\u5f8c\u306b\u51e6\u7406\u5185\u5bb9\u3092\u5b9f\u884c\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">after(:create\u7b49\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u5074\u306e\u30e1\u30bd\u30c3\u30c9) { \u51e6\u7406\u5185\u5bb9(\u4f8b\uff1acreate_list\u7b49\u3067\u8907\u6570\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u308b\u7b49)}<\/pre>\n<h4>\u6ce8\u610f\u70b9<\/h4>\n<p>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3067\u95a2\u9023\u3059\u308b\u30c7\u30fc\u30bf\u3092\u6e96\u5099\u3059\u308b\u5834\u5408\u306fFactoryBot.create\u3088\u308a\u306f<span style=\"color: #ff0000;\"><strong>FactoryBot.build\u3092\u4f7f\u3063\u305f\u65b9\u304c\u826f\u3044\u3002<\/strong><\/span>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u633f\u5165\u3059\u308b\u56de\u6570\u304c\u6e1b\u3063\u3066\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u4e0a\u304c\u308a\u307e\u3059\u3002<\/p>\n<h2>Rspec\uff08\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u5074\uff09<\/h2>\n<h3><span class=\"crayon-v\">FactoryBot<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-e\">create<\/span><\/h3>\n<p>\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3059\u308b\u3002\uff08DB\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002\uff09<\/p>\n<h4>\u7528\u9014<\/h4>\n<p>Rspec\u3067\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u308b\u306e\u3067\u4fdd\u5b58\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6d3b\u7528\u3057\u3066<span style=\"color: #ff0000;\"><strong>\u91cd\u8907\u767b\u9332\u30c1\u30a7\u30c3\u30af<\/strong><\/span>\u3068\u304b\u3092\u3057\u305f\u3044\u5834\u5408\u306b\u6d3b\u7528\u3057\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<h4>\u4f8b<\/h4>\n<pre class=\"lang:default decode:true\">#\u4e0b\u8a18\u4f8b\u306f\u91cd\u8907\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002\r\nFactoryBot.create(:user, email:\"test@example.com\")\r\nuser = FactoryBot.build(:user, email:\"test@example.com\")\r\nuser.valid?<\/pre>\n<h3><span class=\"crayon-v\">FactoryBot<\/span><span class=\"crayon-sy\">.build<\/span><\/h3>\n<p>\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3059\u308b\u3002\uff08DB\u306b\u4fdd\u5b58\u306f\u3055\u308c\u307e\u305b\u3093\u3002\uff09<\/p>\n<h4>\u7528\u9014<\/h4>\n<p>Rspec\u3067\u306f<span style=\"color: #ff0000;\"><strong>\u4e00\u6642\u7684\u306b\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306b\u4fdd\u5b58\u3057\u3066\u30c7\u30fc\u30bf\u3092\u6d3b\u7528\u3057\u305f\u3044<\/strong><\/span>\u7b49\u306e\u76ee\u7684\u3067\u4f7f\u7528\u3057\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<h4>\u4f8b<\/h4>\n<pre class=\"lang:default decode:true \">#user\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u6709\u52b9\u6027(\u4e0d\u6b63\u306a\u5024\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u306a\u3044\u304b)\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3002\r\nuser = FactoryBot.build(:user)\r\nuser.valid?<\/pre>\n<div>\n<h3>FactoryBot.attributes_for(\u8a2d\u5b9a\u5024)<\/h3>\n<div>\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8a2d\u5b9a\u3059\u308b\u3002\u5b9f\u969b\u306f\u6307\u5b9a\u3057\u305f\u30e2\u30c7\u30eb\u306e\u30d5\u30a1\u30af\u30c8\u30ea\u304b\u3089\u30c6\u30b9\u30c8\u7528\u306e<span style=\"color: #ff0000;\"><strong>\u5c5e\u6027\u5024\u306e\u30cf\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/strong><span style=\"color: #000000;\">\u305d\u306e\u5f8c\u306b\u5c5e\u6027\u5024\u3092\u5177\u4f53\u7684\u306b\u6307\u5b9a\u3059\u308c\u3070\u5024\u3092\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/span><\/span><\/div>\n<h4>\u4f8b<\/h4>\n<div>\n<pre class=\"lang:default decode:true \">params = FactoryBot.attributes_for(:\u30e2\u30c7\u30eb\u306e\u30d5\u30a1\u30af\u30c8\u30ea)\r\npost :create, params: { \u30e2\u30c7\u30eb\u540d: params }<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5074 \u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306b\u9023\u756a\u3092\u3064\u3051\u308b\u3002(\u30b7\u30fc\u30b1\u30f3\u30b9\uff09 \u901a\u5e38\u306f\u3001FactoryBot.create\u3084FactoryBot.build\u3092\u8907\u6570\u56de\u5b9f\u884c\u3057\u305f\u5834\u5408\u306f\u5e38\u306b\u540c\u3058\u30c7\u30fc\u30bf\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306bsequence\u3092\u4f7f\u3046 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[82],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9687"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9687"}],"version-history":[{"count":21,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9687\/revisions"}],"predecessor-version":[{"id":20459,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9687\/revisions\/20459"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9687"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}