<commit_before>class DashboardController < ApplicationController

  before_action :authenticate_user!

  expose_decorated(:entries) { current_user.entries }

  def index
    gon.chart_data = ChartDataGenerator.new(entries).generate
  end

end<commit_msg>filter charts based on params (days ago)<commit_after>class DashboardController < ApplicationController

  before_action :authenticate_user!

  expose_decorated(:entries) { current_user.entries.where("date > ?", days_ago) }

  def index
    gon.chart_data = ChartDataGenerator.new(entries).generate
  end

  private

  def days_ago
    (params[:days] || 100).to_i.days.ago
  end
end
{'fraction_non_alphanumeric': 0.0880503144654088, 'fraction_numerical': 0.0047169811320754715, 'mean_word_length': 5.125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '1545263', 'n_tokens_mistral': 201, 'n_tokens_neox': 186, 'n_words': 38}