Skip to content

Commit

Permalink
Merge pull request #441 from dougbradbury/master
Browse files Browse the repository at this point in the history
Sort Tags and Categories by newest first
  • Loading branch information
bricesanchez committed Jun 1, 2016
2 parents 4926254 + c4bdb2f commit 193317e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/refinery/blog/categories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CategoriesController < BlogController

def show
@category = Refinery::Blog::Category.friendly.find(params[:id])
@posts = @category.posts.live.includes(:comments, :categories).with_globalize.page(params[:page])
@posts = @category.posts.live.newest_first.uniq.includes(:comments, :categories).with_globalize.page(params[:page])
end

end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/refinery/blog/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def archive
def tagged
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
@tag_name = @tag.name
@posts = Post.live.tagged_with(@tag_name).page(params[:page])
@posts = Post.live.newest_first.uniq.tagged_with(@tag_name).page(params[:page])
end

private
Expand Down

0 comments on commit 193317e

Please sign in to comment.