Single Table Inheritanceã§è¦ªåé¢ä¿ã«ããäºã¤ã®ã¯ã©ã¹Hoge, Fugaãããã¨ããã class Hoge < ActiveRecord::Base end class Fuga < Hoge end ãã®ã¨ãHogeã¯ã©ã¹ã®ãªãã¸ã§ã¯ãaããã£ãã¨ãã¦ãããFugaã¯ã©ã¹ã«å¤æãããã¨ããã ããããããããç¶æ³ããªãã¸ã§ã¯ãæåçã«ã©ããªã®ãã¨ããã®ã¯ç½®ãã¦ããã ãã®ã¨ãã a = Hoge.find(1) b = a.becomes(Fuga) b.save! ã¨ããã°ããã®ãã¨æã£ã¦è©¦ãã¦ã¿ããããã¼ãããªããããªãã¸ã§ã¯ãã¯Hogeã¯ã©ã¹ã®ã¾ã¾ã ã£ãã ãªãã¸ã§ã¯ããä¿åããã¨ãã®ã¯ã¨ãªã¼ãè¦ãã¨æ¬¡ã®ããã«ãªã£ã¦ããã UPDATE `hoges` SET `type` = 'Fuga', `updated_at` = '2013-04-08 14:0
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}