<commit_before>class Projects::PlansController < BaseProjectController
  load_and_authorize_resource :project
  load_and_authorize_resource :folder, through: :project
  load_and_authorize_resource :platform, through: :project
  load_and_authorize_resource through: :project

  def index
    @plans = @plans.available.page(params[:page]).ranked.page(params[:page]).per(12)
    @plan_phases = @plans.map(&:latest_phase)
    @tasks_count_mapping = Task.where(phase_id: @plan_phases).group(:plan_id, :state).count
  end

  def new
    @plan.title = "Test Plan: #{Date.current}"
  end

  def create
    @plan.creator = current_member
    @test_case_filter = TestCaseFilter.new(filter_params)
    @plan.submit(@test_case_filter)<commit_msg>修复 计划页面计数错误<commit_after>class Projects::PlansController < BaseProjectController
  load_and_authorize_resource :project
  load_and_authorize_resource :folder, through: :project
  load_and_authorize_resource :platform, through: :project
  load_and_authorize_resource through: :project

  def index
    @plans = @plans.available.page(params[:page]).ranked.page(params[:page]).per(12)
    @plan_phases = @plans.map(&:latest_phase)
    @tasks_count_mapping = Task.where(plan_id: @plans).group(:plan_id, :state).count
  end

  def new
    @plan.title = "Test Plan: #{Date.current}"
  end

  def create
    @plan.creator = current_member
    @test_case_filter = TestCaseFilter.new(filter_params)
    @plan.submit(@test_case_filter)
{'fraction_non_alphanumeric': 0.11240575736806031, 'fraction_numerical': 0.0027416038382453737, 'mean_word_length': 5.576576576576577, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4813631', 'n_tokens_mistral': 495, 'n_tokens_neox': 491, 'n_words': 82}