Rails5 ã«ãªã£ã¦ ActiveRecord ã« or ã¯ã¨ãªãå°å ¥ããã¾ãããæ©éãæ¢åã®ã³ã¼ããæ¸ãæãããã¨ãããã§ãããããªãæ éã«ä½¿ããªãã¨çµåé åºã®ã¯ãã«åµã£ã¦ãã°ãããã§æãã§ãã ãã®ãããªï¼éã®æããï¼ã³ã¼ãããã£ãã¨ãã¾ãã Country. where(id: 1). where("id = ? OR id = ?", 1, 2). pluck(:id) çæããã SQL ã¯ããã§ã SELECT "countries"."id" FROM "countries" WHERE "countries"."id" = $1 AND (id = 1 OR id = 2) [["id", 1]] å®è¡çµæã¯ããã [ [0] 1 ] ããããor ã¯ã¨ãªãç¨ãã¦ç´ ç´ã«æ¸ãæãã¦ã¿ã¾ãã Country. where(id: 1). where(id: 1).or(Cou
{{#tags}}- {{label}}
{{/tags}}