I have a scope to limit all questions by whether or not a user has voted on them. In the model:
scope :answered_by, lambda {|u| joins(:votes).wh
try this and let me know if it works
EDIT-1
scope :unanswered_questions, lambda { joins('LEFT OUTER JOIN votes ON questions.id = votes.question_id').where('votes.question_id IS NULL') }
EDIT-2
scope :unanswered_by, lambda {|u| where("questions.id NOT IN (SELECT votes.question_id from votes where votes.user_id = ?)",u.id) }