If I know the current_user‘s answers because the User model has an answers collection:
current_user.answers
How do I test whether that answers collection contains the current answer (referenced by the @answer class variable) at each step of a loop?
I was tempted to use the include? method:
current_user.answers.include?(@answer)
but I see it’s for mixins 🙁
All Enumerable collections (including Arrays, Hashes and Sets) have the
include?method to test membership.(There’s also an
include?method that modules have, but it’s not the same thing.)