 <p>You could do something like</p> <pre><code>current_user.views.where(:post_id =&gt; post.id) # this may work, not sure current_user.views.where(:post =&gt; post) </code></pre> <p>or</p> <pre><code>post.views.where(:user_id =&gt; current_user.id) # this may work, not sure post.views.where(:user =&gt; current_user) </code></pre>