diff --git a/app/models/course.rb b/app/models/course.rb index 4e3b4fff0..24e955d15 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -1,6 +1,7 @@ require 'elasticsearch/model' class Course < ActiveRecord::Base include Redmine::SafeAttributes + include ApplicationHelper STATUS_ACTIVE = 1 STATUS_CLOSED = 5 diff --git a/app/models/issue.rb b/app/models/issue.rb index 33005ff57..e1de4cd9e 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -19,6 +19,7 @@ class Issue < ActiveRecord::Base include Redmine::SafeAttributes include Redmine::Utils::DateCalculation include UserScoreHelper + include ApplicationHelper belongs_to :project,:touch=> true belongs_to :tracker belongs_to :status, :class_name => 'IssueStatus', :foreign_key => 'status_id' diff --git a/app/models/message.rb b/app/models/message.rb index 1f8dbaace..618fb4659 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -36,7 +36,6 @@ class Message < ActiveRecord::Base has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy # 课程动态 has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy - has_many :user_acts, :class_name => 'UserActivity',:as =>:user_act ,:dependent => :destroy # end # 课程/项目 消息 diff --git a/app/models/org_document_comment.rb b/app/models/org_document_comment.rb index 75db910c3..5aa3c1dab 100644 --- a/app/models/org_document_comment.rb +++ b/app/models/org_document_comment.rb @@ -1,6 +1,7 @@ class OrgDocumentComment < ActiveRecord::Base attr_accessible :content, :creator_id, :organization_id, :parent_id, :reply_id, :title,:sticky,:locked include Redmine::SafeAttributes + include ApplicationHelper belongs_to :organization belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id' has_many :editor_of_documents, :dependent => :destroy diff --git a/app/models/poll.rb b/app/models/poll.rb index 41bfe8a72..b0499b572 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -1,7 +1,8 @@ class Poll < ActiveRecord::Base #attr_accessible :closed_at, :polls_group_id, :polls_name, :polls_status, :polls_type, :published_at, :user_id include Redmine::SafeAttributes - + include ApplicationHelper + belongs_to :user has_many :poll_questions, :dependent => :destroy,:order => "#{PollQuestion.table_name}.question_number" has_many :poll_users, :dependent => :destroy