Railsã§ããã°ã©ã ãæ¸ããã¨SQLãç´æ¥è¨è¿°ããæ©ä¼ãæå¤ã¨å¤ãã®ã§ã ãªãã¹ãRubyãããæ¸ãæ¹æ³ããªãã調ã¹ã¦ã¿ã¾ããã ORãªã©ããªãåºæ¬çãªæ§æã§ãarel_tableã使ãå¿ è¦ãããã®ã§ããã ã¨ããããã§ãArel::Table ã使ã£ã¦ã¿ã¾ããã åä½ç¢ºèªç°å¢ã¯ä»¥ä¸ã®éãã§ãã ruby: 1.9.3-p392 Rails: 3.2.13 arel: 3.0.2 MySQL: 5.1.65 æ¤ç´¢æ¡ä»¶ãORã§ç¹ããã åºæ¬çãªæ§æã§ããSQLãç´æ¥è¨è¿°ããå ´åãå¤ãã®ã§ã¯ãªãã§ããããï¼ User.where("name = ? OR name = ?", "太é", "è±å").to_sql #=> "SELECT `users`.* FROM `users` WHERE (name = '太é' OR name = 'è±å')" ãªãã¹ãRubyã§æ¸ããã¨ããã¨ãããª
{{#tags}}- {{label}}
{{/tags}}