修改发系统消息后跳转路劲
This commit is contained in:
parent
001c2f48f6
commit
cc3990de44
|
@ -42,7 +42,7 @@ class SystemMessagesController < ApplicationController
|
|||
@system_messages.user_id = User.current.id
|
||||
respond_to do |format|
|
||||
if @system_messages.save
|
||||
format.html {redirect_to system_messages_url(@project)}
|
||||
format.html {redirect_to user_message_path(User.current, :type => "system_message")}
|
||||
flash[:notice] = l(:notice_successful_message)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#coding=utf-8
|
||||
#
|
||||
|
||||
class HomeworkEndtimeTask
|
||||
def massage_for_endtime
|
||||
desc "send a message for Job deadline"
|
||||
task :message => :environment do
|
||||
current_day = Date.today.day
|
||||
homework_commons = HomeworkCommon.where("end_time >?",Date.today)
|
||||
homework_commons.each do |homework_common|
|
||||
if homework_common.end_time.day - Date.today < 2 && homework_common.end_time.year == Date.year
|
||||
homework_common.course.student.each do |s|
|
||||
homework_common.course_messages << CourseMessage.new(:user_id => s.student_id, :course_id => homework_common.course_id, :viewed => false, :course_message_id => homework_common.id, :course_message_type => "HomeworkEndtime")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
handle_asynchronously :massage_for_endtime, :run_at => HomeworkEndtimeTask.new { 1.minutes.from_now }
|
||||
end
|
||||
|
||||
homwork_endtime = HomeworkEndtimeTask.new
|
||||
homwork_endtime.massage_for_endtime
|
||||
end
|
|
@ -265,7 +265,6 @@ RedmineApp::Application.routes.draw do
|
|||
collection do
|
||||
post 'create', :as => 'system_messages'
|
||||
get 'index', :as => 'index'
|
||||
get 'show', :as => 'show'
|
||||
end
|
||||
end
|
||||
# match 'system_messages/index', to: 'system_messages#index', :via => :get, :as => 'system_messages'
|
||||
|
|
Loading…
Reference in New Issue