From 2395ee4b1d6e02e298d1c29824780f770a060f68 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 4 Jul 2014 15:41:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=8F=91=E9=80=81=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 9 ++++++--- db/schema.rb | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 81ef95c8..09db4de9 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 32a903aa..fd5c9741 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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"