Skip to content

Commit

Permalink
sort published drafts by last updated
Browse files Browse the repository at this point in the history
  • Loading branch information
TildaDares committed Aug 5, 2021
1 parent f775696 commit a2ce562
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ def activity
# remove "classroom" postings; also switch to an EXCEPT operator in sql, see https://github.com/publiclab/plots2/issues/375
hidden_nids = Node.hidden_response_node_ids
notes = Node.where(type: 'note')
.includes(:revision)
.references(:node_revision)
.where('node.nid NOT IN (?)', hidden_nids + [0]) # in case hidden_nids is empty
.order('nid DESC')
.order('node_revisions.timestamp DESC')
.page(params[:page])
notes = notes.where('nid != (?)', blog.nid) if blog
notes = notes.where('node.nid != (?)', blog.nid) if blog

comments = Comment.joins(:node, :user)
.includes(:node)
Expand Down

0 comments on commit a2ce562

Please sign in to comment.