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