<commit_before>class ReportsController < ApplicationController
  active_tab "reports"

  require_permission :can_view_reports?
  before_action :store_filters

  def value_by_donor
    @report = Reports::ValueByDonor.new(params, session)
  end

  def value_by_county
    @report = Reports::ValueByCounty.new(params, session)
  end

  def total_inventory_value
    @report = Reports::TotalInventoryValue.new(params, session)
  end

  def orders_by_create_date_graph
    @report = Order.group("date(created_at)").count
  end

  private

  def store_filters
    [:report_start_date, :report_end_date].each do |key|<commit_msg>Update controller to use new graphs models<commit_after>class ReportsController < ApplicationController
  active_tab "reports"

  require_permission :can_view_reports?
  before_action :store_filters

  def value_by_donor
    @report = Reports::ValueByDonor.new(params, session)
  end

  def value_by_county
    @report = Reports::ValueByCounty.new(params, session)
  end

  def total_inventory_value
    @report = Reports::TotalInventoryValue.new(params, session)
  end

  def graphs
    @report_by_date = Reports::Graphs.order_count_by_day
    @report_by_month = Reports::Graphs.order_count_by_month
  end

  private

  def store_filters
    [:report_start_date, :report_end_date].each do |key|
{'fraction_non_alphanumeric': 0.0774487471526196, 'fraction_numerical': 0.0, 'mean_word_length': 5.045871559633028, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5269927', 'n_tokens_mistral': 444, 'n_tokens_neox': 410, 'n_words': 85}