ActiveRecordã§ãã使ãï¼ã¤ã®åé¤ç³»ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãããdelete, delete_all, destroy, destroy_allã å人çã«æ¯å使ãåããæ··ä¹±ãã¦ãã¾ãã®ã§ãããããã®åä½ãã¾ã¨ãã¾ããã åæ Rails5ç³» Ruby-2.4 ã¢ãã«é¢é£ã¯ä»¥ä¸ã®ãããªæããæ³å®ãã¦ã¾ã¨ãã¾ããï¼RailsGuidesåç §ï¼ destroy åé¤ãè¡ãéã«ä¸çªä½¿ãã¡ã½ããï¼ã ã¨æãï¼ã ActiveRecordãä»ãã¦æå®ããæ¡ä»¶ã®ã¬ã³ã¼ããåé¤ãããåé¤ããéã«ãModelã«dependent: :destroyãè¨å®ããã¦ããé¢é£ãããå ´åããã®é¢é£ãä¸ç·ã«åé¤ãã¦ãããã ä¾ãã°ãAuthor.find(1).destroyã¨ããã°ãä¸äººã®Authorã¨ããã«é¢é£ãã¦ããBookéãåé¤ãã¦ãããã 注æããªãã¨ãããªãã®ã¯ãModelã«è¨å®ããdependent
{{#tags}}- {{label}}
{{/tags}}