lib/redd/models/more_comments.rb in redd-0.8.1 vs lib/redd/models/more_comments.rb in redd-0.8.2

- old
+ new

@@ -22,10 +22,10 @@ # Keep expanding until all top-level MoreComments are converted to comments. # @param link [Submission] the object's submission # @param sort [String] the sort order of the returned comments # @param lookup [Hash] a hash of comments to add future replies to # @param depth [Number] the maximum recursion depth - # @return [Array<Comment, MoreComments>] the expanded comments or {self} if past depth + # @return [Array<Comment, MoreComments>] the expanded comments or self if past depth def recursive_expand(link:, sort: 'best', lookup: {}, depth: 10) return [self] if depth == 0 expand(link: link, sort: sort).flat_map do |thing| if thing.is_a?(MoreComments) && thing.count > 0