AyuntamientoMadrid/participacion

View on GitHub
app/lib/merged_comment_tree.rb

Summary

Maintainability
A
0 mins
Test Coverage
class MergedCommentTree < CommentTree
  attr_reader :commentables

  def initialize(commentables, page, order = "confidence_score")
    @commentables = commentables
    super(commentables.first, page, order)
  end

  def base_comments
    Comment.where(commentable: commentables.flatten)
  end
end