AutoCommit Don Jul 30 14:03:07 CEST 2015
This commit is contained in:
@@ -14,6 +14,7 @@ class Survey::Question < ActiveRecord::Base
|
||||
|
||||
def do_answer(choice_ids, user)
|
||||
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
|
||||
cid.each do |c|
|
||||
if self.choice_ids.include?(c)
|
||||
@@ -21,6 +22,7 @@ class Survey::Question < ActiveRecord::Base
|
||||
a.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user