Skip to content

Commit

Permalink
update home_controller.rb file for issue #11499
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorcas-BD committed Oct 17, 2022
1 parent a5d2483 commit 32ab89d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def activity
.page(params[:page])
.group(['title', 'comments.cid']) # ONLY_FULL_GROUP_BY, issue #3120

if logged_in_as(['admin', 'moderator'])
if logged_in_as((%w(moderator admin)))
notes = notes.where('(node.status = 1 OR node.status = 3)')
comments = comments.where('comments.status = 1')
elsif current_user
Expand Down Expand Up @@ -140,15 +140,7 @@ def activity
comments = comments.group('DATE(FROM_UNIXTIME(timestamp))') if Rails.env == 'production'
comments = comments.to_a # ensure it can be serialized for caching
activity = (notes + wikis + comments).sort_by(&:created_at).reverse
response = [
activity,
blog,
notes,
wikis,
revisions,
comments
]
response
[activity, blog, notes, wikis, revisions, comments]
end

def trending
Expand Down

0 comments on commit 32ab89d

Please sign in to comment.