{"description":"Ruby\u306e\u914d\u5217\u306bjoin\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9 \u914d\u5217\u306e\u8981\u7d20\u306e\u9593\u306b\u6587\u5b57\u5217\u3092\u631f\u3093\u3067\u9023\u7d50\u3057\u3001\u6587\u5b57\u5217\u3092\u8fd4\u3059 [a,b,c].join(\"-\") #=>\"a-b-c\" Rails\u306eModel\u306bjoins\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9 Rails\u306e\u30e2\u30c7\u30eb\u306b\u4f7f\u3063\u305fjoins\u306f\u30e2\u30c7\u30eb\u3068\u30c6\u30fc\u30d6\u30eb\u304c\u5185\u90e8\u7d50\u5408\uff08INNER JOIN\uff09\u3057\u3066\u7d50\u5408\u5148\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308b User.joins(:children) #=> children\u304c\u3042\u308bUser\u305f\u3061\u3060\u3051\u53d6\u5f97\u3059\u308b SQL\u6587\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059 SELECT u.* FROM users u INNER JOIN children c ON u.id = c.user_id","type":"rich","author_name":"xiaoniu","version":"1.0","blog_url":"https://xiaoniu.hateblo.jp/","width":"100%","image_url":null,"published":"2020-05-21 17:36:15","provider_url":"https://hatena.blog","url":"https://xiaoniu.hateblo.jp/entry/2020/05/21/173615","author_url":"https://blog.hatena.ne.jp/xiaoniu/","blog_title":"xiaoniu\u2019s blog","height":"190","title":"Rails\u306eActiveRecord\u306b\u4f7f\u3063\u305fjoins\u3068Ruby\u306e\u914d\u5217join","categories":["Rails"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxiaoniu.hateblo.jp%2Fentry%2F2020%2F05%2F21%2F173615\" title=\"Rails\u306eActiveRecord\u306b\u4f7f\u3063\u305fjoins\u3068Ruby\u306e\u914d\u5217join - xiaoniu\u2019s blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog"}