{"blog_url":"https://next49.hatenadiary.jp/","width":"100%","url":"https://next49.hatenadiary.jp/entry/20150131/p1","image_url":null,"type":"rich","provider_url":"https://hatena.blog","categories":["RoR"],"height":"190","version":"1.0","published":"2015-01-31 00:00:00","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnext49.hatenadiary.jp%2Fentry%2F20150131%2Fp1\" title=\" Single Table Inheritance \u3092\u5229\u7528\u3057\u3001\u304b\u3064\u3001form_for \u3067\u306f\u89aa\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f7f\u3044\u305f\u3044\u3068\u304d - \u767a\u58f0\u7df4\u7fd2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/next49/","blog_title":"\u767a\u58f0\u7df4\u7fd2","author_name":"next49","description":"\u3053\u3093\u306a\u4eba\u79c1\u306e\u4ed6\u306b\u3044\u308b\u306e\u304b\u308f\u304b\u3089\u306a\u3044\u3051\u3069\u3001\u30cf\u30de\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002 \u524d\u63d0 Fruit \u30e2\u30c7\u30eb\u3092\u7d99\u627f\u3057\u305f Apple \u3068 Orange \u3092 Single Table Inheritance \u3067\u5b9f\u73fe\u3059\u308b\u3002 # app/models/fruit.rb class Fruit < ActiveRecord::Base self.inheritance_column = :type \u301c\u7701\u7565\u301c end class Apple < Fruit \u301c\u7701\u7565\u301c end class Orange < Fruit \u301c\u7701\u7565\u301c end\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306f Fruit\u306e\u3082\u306e\u3092\u5171\u6709\u3059\u308b\u3002 # config/routes.rb resour\u2026","title":" Single Table Inheritance \u3092\u5229\u7528\u3057\u3001\u304b\u3064\u3001form_for \u3067\u306f\u89aa\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f7f\u3044\u305f\u3044\u3068\u304d"}