Skip to content

Commit

Permalink
sort by date
Browse files Browse the repository at this point in the history
  • Loading branch information
garrett committed Jul 7, 2016
1 parent 3aee297 commit 179b296
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/blog_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def articles_by_tag(searched_tag)
end

# Join array(s) to just return results
# then sort by URL (which sorts by date, then alpha)
# then sort by date
tag_matches
.inject([]) { |result, d| result + d[1] }
.sort_by { |t| t[:url] }
.sort_by { |t| t[:date] }
end

end
Expand Down

0 comments on commit 179b296

Please sign in to comment.