I have the following code:
@posts = Post.joins(:user).joins(:blog).select
which is designed to search for all posts and return them, as well as related users and blogs. However, users are optional, which means that the INNER JOIN that generates :joins does not return many records.
How to use this to generate a LEFT OUTER JOIN instead?
ruby ruby-on-rails activerecord
Neil Middleton Jul 14 '10 at 10:22 2010-07-14 10:22
source share