forked from jacknudt/trustieforge
留言发送邮件优化
This commit is contained in:
parent
698870ddee
commit
2395ee4b1d
|
@ -46,6 +46,8 @@ class Mailer < ActionMailer::Base
|
||||||
when :Project
|
when :Project
|
||||||
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
|
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
|
||||||
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
||||||
|
when :Course
|
||||||
|
course_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
||||||
when :Contest
|
when :Contest
|
||||||
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
||||||
when :User
|
when :User
|
||||||
|
@ -54,9 +56,10 @@ class Mailer < ActionMailer::Base
|
||||||
Rails.logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}"
|
Rails.logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}"
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
#如果是直接留言并且留言对象是Project并且Project类型是课程
|
# modify by nwb
|
||||||
if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Project && journals_for_message.jour.project_type == 1
|
#如果是直接留言并且留言对象是课程
|
||||||
project = journals_for_message.jour
|
if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Course
|
||||||
|
course = journals_for_message.jour
|
||||||
@author = journals_for_message.user
|
@author = journals_for_message.user
|
||||||
#课程的教师
|
#课程的教师
|
||||||
@teachers = searchTeacherAndAssistant journals_for_message.jour
|
@teachers = searchTeacherAndAssistant journals_for_message.jour
|
||||||
|
|
20
db/schema.rb
20
db/schema.rb
|
@ -796,18 +796,18 @@ ActiveRecord::Schema.define(:version => 20140704034832) do
|
||||||
create_table "relative_memos", :force => true do |t|
|
create_table "relative_memos", :force => true do |t|
|
||||||
t.integer "osp_id"
|
t.integer "osp_id"
|
||||||
t.integer "parent_id"
|
t.integer "parent_id"
|
||||||
t.string "subject", :null => false
|
t.string "subject", :null => false
|
||||||
t.text "content", :limit => 16777215, :null => false
|
t.text "content", :null => false
|
||||||
t.integer "author_id"
|
t.integer "author_id"
|
||||||
t.integer "replies_count", :default => 0
|
t.integer "replies_count", :default => 0
|
||||||
t.integer "last_reply_id"
|
t.integer "last_reply_id"
|
||||||
t.boolean "lock", :default => false
|
t.boolean "lock", :default => false
|
||||||
t.boolean "sticky", :default => false
|
t.boolean "sticky", :default => false
|
||||||
t.boolean "is_quote", :default => false
|
t.boolean "is_quote", :default => false
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
t.integer "viewed_count_crawl", :default => 0
|
t.integer "viewed_count_crawl", :default => 0
|
||||||
t.integer "viewed_count_local", :default => 0
|
t.integer "viewed_count_local", :default => 0
|
||||||
t.string "url"
|
t.string "url"
|
||||||
t.string "username"
|
t.string "username"
|
||||||
t.string "userhomeurl"
|
t.string "userhomeurl"
|
||||||
|
|
Loading…
Reference in New Issue