AutoCommit Fre Jul 31 10:03:05 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-07-31 10:03:05 +02:00
parent a9e413ada0
commit b450757e47
5 changed files with 472 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ class Survey::Question < ActiveRecord::Base
end
def do_answer(choice_ids, user)
unless user.nil?
cid=choice_ids.map{|c|c.to_i}
unless cid.empty?
Survey::Answer.where(user_id: user.id, choice_id: self.choice_ids).delete_all
@@ -25,4 +26,5 @@ class Survey::Question < ActiveRecord::Base
end
end
end
end