diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 997bb6f62..f2b69da81 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -15,9 +15,9 @@ class JournalsForMessage < ActiveRecord::Base "m_reply_id" # 回复某留言的留言id(a留言回复了b留言,这是b留言的id) acts_as_tree :foreign_key => 'm_parent_id', :counter_cache => :m_reply_count, :order => "#{JournalsForMessage.table_name}.created_on ASC" - belongs_to :project - #:foreign_key => 'jour_id', - #:conditions => "#{self.table_name}.jour_type = 'Project' " + belongs_to :project, + :foreign_key => 'jour_id', + :conditions => "#{self.table_name}.jour_type = 'Project' " belongs_to :course, :foreign_key => 'jour_id', :conditions => "#{self.table_name}.jour_type = 'Course' "