From 77cc4ad6257d406f51accea5ca992b06c3714e2a Mon Sep 17 00:00:00 2001 From: r888888888 Date: Sat, 20 Oct 2018 20:08:42 -0700 Subject: [PATCH] marginally smarter PostSets::Post#best_post algorithm --- app/logical/post_sets/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 78e401668..b4a350c3c 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -187,7 +187,7 @@ module PostSets def best_post # be smarter about this in the future - posts[0] + posts.max {|a, b| a.fav_count <=> b.fav_count} end end end