I have a scope to limit all questions by whether or not a user has voted on them. In the model:
questions
scope :answered_by, lambda {|u| joins(:votes).wh
And if you want to do EXISTS query in elegant and Rails-ish manner, you can use Where Exists gem I've written:
EXISTS
Question.where_not_exists(:votes, user_id: current_user.id)
Of course, you can made scope of it as well:
scope :unanswered_by, ->(user){ where_not_exists(:votes, user_id: user.id) }