diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb index be1c77aa2..fdd33485d 100644 --- a/app/controllers/praise_tread_controller.rb +++ b/app/controllers/praise_tread_controller.rb @@ -20,7 +20,12 @@ class PraiseTreadController < ApplicationController @obj_type = params[:obj_type] #@horizontal = params[:horizontal].downcase == "false" ? false:true @obj = find_object_by_type_and_id(@obj_type,@obj_id) - unless @obj.author_id == User.current.id + if @obj.respond_to?("author_id") + author_id = @obj.author_id + elsif @obj.respond_to?("user_id") + author_id = @obj.user_id + end + unless author_id == User.current.id praise_tread_plus(@obj_type,@obj_id,1) end respond_to do |format| @@ -102,6 +107,10 @@ class PraiseTreadController < ApplicationController @obj = Memo.find_by_id(id) when 'Message' @obj = Message.find_by_id(id) + when 'HomeworkCommon' + @obj = HomeworkCommon.find_by_id(id) + when 'JournalsForMessage' + @obj = JournalsForMessage.find_by_id(id) end return @obj end diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 4f2a7b662..7f032d704 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -223,10 +223,16 @@ <% count=activity.journals_for_messages.count %>