Skip to content

Commit

Permalink
Sort wikis by popularity corrected (#2002)
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthBansal authored and jywarren committed Jan 17, 2018
1 parent 3702e83 commit 5289334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/wiki_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,11 @@ def stale
def popular
@title = I18n.t('wiki_controller.popular_wiki_pages')
@wikis = Node.limit(40)
.order('views DESC')
.joins(:revision)
.group('node_revisions.nid')
.order('node_revisions.timestamp DESC')
.where("node.status = 1 AND node_revisions.status = 1 AND node.nid != 259 AND (type = 'page' OR type = 'tool' OR type = 'place')")
.sort_by(&:totalviews).reverse
render template: 'wiki/index'
end

Expand Down

0 comments on commit 5289334

Please sign in to comment.