You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: posts.rb
    path of file: ./repos/discourse/app/models/concerns/reports
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Reports::Posts
  extend Activ
    
    def report_posts(report)
      report.modes = %i[table chart]

      category_id, include_subcategories = report.add_category_filter

      basic_report_about report,
                         Post,
                         :public_posts_count_per_day,
                         report.start_date,
                         report.end_date,
                         category_id,
                         include_subcategories

      countable = Post.public_posts.where(post_type: Post.types[:regular])
      if category_id
        if include_subcategories
          countable =
            countable.joins(:topic).where(
              "topics.category_id IN (?)",
              Category.subcategory_ids(category_id),
            )
        else
          countable = countable.joins(:topic).where("topics.category_id = ?", category_id)
        end