Merge branch 'master' into groups

This commit is contained in:
nilsding 2015-01-14 17:38:47 +01:00
commit e5b753681c
1 changed files with 2 additions and 5 deletions

View File

@ -112,8 +112,7 @@ class User < ActiveRecord::Base
# has the user answered +question+ yet?
# @param question [Question]
def answered?(question)
question.answers.each { |a| return true if a.user_id == self.id }
false
question.answers.pluck(:user_id).include? self.id
end
# smiles an answer
@ -129,9 +128,7 @@ class User < ActiveRecord::Base
end
def smiled?(answer)
# TODO: you know what to do here, nilsding
answer.smiles.each { |s| return true if s.user_id == self.id }
false
answer.smiles.pluck(:user_id).include? self.id
end
def display_website