ActiveRecord4ã§ãããªSQLã¯ã¨ãªã©ãæ¸ãã®ï¼ Mergeç·¨ #activerecord#rails#ruby 2013å¹´ 10æ 24æ¥ nishio ããã®ãã¼ã¿åå¾ããã®ã«SQLã§ã¯ãããã風ã«æ¸ãã°ãããã ãã©ãActiveRecordã§ã¯ä¸ä½ã©ãæ¸ãã°ããã®ï¼ã æ¯åãã®èª²é¡ã«æ©ã¾ããã¦ãã¾ãã ç¹ã«æ¥åã¢ããªã®å ´åãã¨ã¦ã¤ããªãè¤éãªSQLãæããå ´åãããã¾ãã ãã®ãããæ°ã®ãã¼ãã«ãjoinãã¦ãexistsã§æ¡ä»¶ã¿ã¦ãunion allãã¦ããã ãªãã¦ããå¦çãã§ã¦ããã¨ããããã«ActiveRecordãDatamapperã使ã£ã¦ã¯ã¨ãªãçµã¿ç«ã¦ãã®ãããããã¦ãç´æ¥SQLãæ¸ãã¦ãã¾ããã¨ãããã¾ãã ã§ããã§ããã°ActiveRecordã使ã£ã¦ã¹ãã¼ãã«SQLãçµã¿ç«ã¦ãããã®ã§ãã scopeã§æ¸ãã¦ããã°ãå¦çã使ãåãã¾ãããã ã¨ãããã¨
{{#tags}}- {{label}}
{{/tags}}