留言发送邮件优化

This commit is contained in:
nwb 2014-07-04 15:41:26 +08:00
parent 698870ddee
commit 2395ee4b1d
2 changed files with 16 additions and 13 deletions

View File

@ -46,6 +46,8 @@ class Mailer < ActionMailer::Base
when :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}")
when :Course
course_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Contest
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
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}"
return -1
end
#如果是直接留言并且留言对象是Project并且Project类型是课程
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
# modify by nwb
#如果是直接留言并且留言对象是课程
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
#课程的教师
@teachers = searchTeacherAndAssistant journals_for_message.jour

View File

@ -796,18 +796,18 @@ ActiveRecord::Schema.define(:version => 20140704034832) do
create_table "relative_memos", :force => true do |t|
t.integer "osp_id"
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :limit => 16777215, :null => false
t.string "subject", :null => false
t.text "content", :null => false
t.integer "author_id"
t.integer "replies_count", :default => 0
t.integer "replies_count", :default => 0
t.integer "last_reply_id"
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
t.string "url"
t.string "username"
t.string "userhomeurl"