def find_related_posts
      @related_posts = @post.find_related_tags.limit(amount_of_related_posts_to_display)
      amount_of_related_posts = @related_posts.length

      if amount_of_related_posts != amount_of_related_posts_to_display && (amount_of_related_posts + @popular_posts.length) >= amount_of_related_posts_to_display
        @related_posts = @related_posts.to_a.concat(@popular_posts[0...amount_of_related_posts_to_display - amount_of_related_posts])
      end
    end
def find_related_posts
      @related_posts = @post.find_related_tags.limit(amount_of_related_posts_to_display)
      amount_of_related_posts = @related_posts.length

      if amount_of_related_posts != amount_of_related_posts_to_display && (amount_of_related_posts + @popular_posts.length) >= amount_of_related_posts_to_display
        @related_posts = @related_posts.to_a.concat(@popular_posts[0...amount_of_related_posts_to_display - amount_of_related_posts])
      end
    end
Creates array of related posts. If enough related posts do not exist uses popular posts