作业列表设留言at消息为已读改为delay_job执行
This commit is contained in:
parent
7e657a4ad0
commit
88d489b485
|
@ -34,11 +34,11 @@ class HomeworkCommonController < ApplicationController
|
|||
@homeworks = paginateHelper @homework_commons,10
|
||||
#设置at已读
|
||||
@homeworks.each do |homework|
|
||||
homework.journals_for_messages.each do |j|
|
||||
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
|
||||
end
|
||||
# homework.journals_for_messages.each do |j|
|
||||
# User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
|
||||
# end
|
||||
homework.delay.set_jour_viewed
|
||||
end
|
||||
|
||||
@left_nav_type = 3
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -135,6 +135,12 @@ class HomeworkCommon < ActiveRecord::Base
|
|||
# end
|
||||
# end
|
||||
|
||||
def set_jour_viewed
|
||||
self.journals_for_messages.each do |j|
|
||||
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
|
||||
end
|
||||
end
|
||||
|
||||
delegate :language_name, :language, :to => :homework_detail_programing
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue