diff --git a/app/api/mobile/entities/activity.rb b/app/api/mobile/entities/activity.rb index b2581c319..3cd4ce6c0 100644 --- a/app/api/mobile/entities/activity.rb +++ b/app/api/mobile/entities/activity.rb @@ -25,8 +25,10 @@ module Mobile elsif ac.act_type == "News" ac.nil? || ac.act.nil? ? 0 : ac.act.comments.count elsif ac.act_type == "Message" || ac.act_type == "BlogComment" || ac.act_type == "JournalsForMessage" - all_comments = [] - ac.nil? || ac.act.nil? ? 0 : get_all_children(all_comments, ac.act).count + className = ac.act_type.classify.constantize + # all_comments = [] + # ac.nil? || ac.act.nil? ? 0 : get_all_children(all_comments, ac.act).count + ac.nil? || ac.act.nil? ? 0 : className.where("root_id = #{ac.act.id}").count elsif ac.act_type == "Issue" ac.nil? || ac.act.nil? ? 0 : ac.act.journals.where("notes is not null and notes != ''").count end