|
|
|
@ -19,6 +19,14 @@ class Comment < ActiveRecord::Base
|
|
|
|
|
include Redmine::SafeAttributes
|
|
|
|
|
include ApplicationHelper
|
|
|
|
|
has_many_kindeditor_assets :assets, :dependent => :destroy
|
|
|
|
|
|
|
|
|
|
has_many :ActivityNotifies,:as => :activity, :dependent => :destroy
|
|
|
|
|
acts_as_event :datetime => :updated_on,
|
|
|
|
|
:description => :comments,
|
|
|
|
|
:type => 'news',
|
|
|
|
|
:title=>Proc.new {|o| "RE: #{o.commented.title}" },
|
|
|
|
|
:url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.commented.id} }
|
|
|
|
|
|
|
|
|
|
belongs_to :commented, :polymorphic => true, :counter_cache => true
|
|
|
|
|
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
|
|
|
|
validates_presence_of :commented, :author, :comments
|
|
|
|
@ -38,4 +46,17 @@ class Comment < ActiveRecord::Base
|
|
|
|
|
def delete_kindeditor_assets
|
|
|
|
|
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::COMMENT
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def set_notify_id(notify_id)
|
|
|
|
|
@notify_id= notify_id
|
|
|
|
|
end
|
|
|
|
|
def get_notify_id()
|
|
|
|
|
return @notify_id
|
|
|
|
|
end
|
|
|
|
|
def set_notify_is_read(notify_is_read)
|
|
|
|
|
@notify_is_read = notify_is_read
|
|
|
|
|
end
|
|
|
|
|
def get_notify_is_read()
|
|
|
|
|
return @notify_is_read
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|