title: ActiveRecord Joins
body: <p>I'm just trying to use ActiveRecord to the best of it's ability and am having trouble doing joins in the way I would like.</p>
  
  <p>Here is how my models are set up:</p>
  
  <pre><code>class Model
      has_many :likes
  end
  
  class Like
      belongs_to :model
      belongs_to :user
  end
  
  class User
      has_many :likes
  end
  </code></pre>
  
  <p>I would like to get all the likes from a 'model' object and from there get all the users that made the like. So this is what my ActiveRecord query is</p>
  
  <pre><code>@model = Model.find(params[:id])
  @users = @model.likes.joins(:user)
  </code></pre>
  
  <p>However, what that last line of code returns is a like, not a user. Is there any way to use joins appropriately and do what I want?</p>
  
  <p>Thanks,<br>
  DO </p>