{"categories":["Ruby"],"url":"https://ayaketan.hatenablog.com/entry/2013/12/24/161538","blog_url":"https://ayaketan.hatenablog.com/","image_url":null,"published":"2013-12-24 16:15:38","title":"Rails4 ActiveRecord\u3067IN\u3092\u4f7f\u7528\u3057\u305f\u3044\u5834\u5408\u3001\u30cf\u30c3\u30b7\u30e5\u3067\u6307\u5b9a\u3067\u304d\u308b","blog_title":"ayaketan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u65e5\u8a18","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fayaketan.hatenablog.com%2Fentry%2F2013%2F12%2F24%2F161538\" title=\"Rails4 ActiveRecord\u3067IN\u3092\u4f7f\u7528\u3057\u305f\u3044\u5834\u5408\u3001\u30cf\u30c3\u30b7\u30e5\u3067\u6307\u5b9a\u3067\u304d\u308b - ayaketan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","type":"rich","width":"100%","author_url":"https://blog.hatena.ne.jp/ayaketan/","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","version":"1.0","description":"ActiveRecord\u3067IN\u3092\u4f7f\u7528\u3057\u305f\u304b\u3063\u305f\u3002\u60f3\u5b9a\u3057\u305fSQL\u306f\u4e0b\u8a18\u3002 SELECT * FROM tests WHERE user_id IN (1, 2, 3) \u6700\u521d\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8f09\u3057\u305f\u304c\u3001\u3082\u3063\u3068\u30b9\u30de\u30fc\u30c8\u306a\u65b9\u6cd5\u304c\u3042\u3063\u305f\u3002 Tests.where(\"user_id IN (?)\", [1, 2, 3]) \u4e0b\u8a18\u306e\u3088\u3046\u306b\u30cf\u30c3\u30b7\u30e5\u3067\u914d\u5217\u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3067\u3088\u304b\u3063\u305f\u3002 Tests.where(:user_id => [1, 2, 3]) \u53c2\u8003\uff1a Ruby Activerecord IN clause - Stack Overflow","author_name":"ayaketan"}