diff --git a/app/logical/related_tag_calculator.rb b/app/logical/related_tag_calculator.rb index 9905d21aa..2818bb961 100644 --- a/app/logical/related_tag_calculator.rb +++ b/app/logical/related_tag_calculator.rb @@ -69,7 +69,7 @@ class RelatedTagCalculator end def self.convert_hash_to_array(hash, limit = MAX_RESULTS) - hash.to_a.sort_by {|x| -x[1]}.slice(0, limit) + hash.to_a.sort_by {|x| [-x[1], x[0]] }.slice(0, limit) end def self.convert_hash_to_string(hash)