|
|
|
@ -18,6 +18,7 @@ class BlogComment < ActiveRecord::Base
|
|
|
|
|
|
|
|
|
|
after_save :add_user_activity
|
|
|
|
|
after_update :update_activity
|
|
|
|
|
after_create :update_parent_time
|
|
|
|
|
before_destroy :destroy_user_activity
|
|
|
|
|
|
|
|
|
|
scope :like, lambda {|arg|
|
|
|
|
@ -64,6 +65,11 @@ class BlogComment < ActiveRecord::Base
|
|
|
|
|
(user && user.logged? && (self.author == user) ) || user.admin?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update_parent_time
|
|
|
|
|
if !self.parent.nil?
|
|
|
|
|
self.root.update_attribute(:updated_on, self.updated_on)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
def project
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|