<commit_before>class Officing::PollsController < Officing::BaseController

  def index
    @polls = current_user.poll_officer? ? current_user.poll_officer.voting_days_assigned_polls : []
    @polls = @polls.select {|poll| poll.current?(Time.current) || poll.current?(1.day.ago)}
  end

  def final
    @polls = current_user.poll_officer? ? current_user.poll_officer.final_days_assigned_polls : []
    return unless current_user.poll_officer?

    @polls = @polls.select {|poll| poll.ends_at > 1.week.ago && poll.expired?}
  end

end<commit_msg>Refactor officing polls #final method to be cleaner<commit_after>class Officing::PollsController < Officing::BaseController

  def index
    @polls = current_user.poll_officer? ? current_user.poll_officer.voting_days_assigned_polls : []
    @polls = @polls.select {|poll| poll.current?(Time.current) || poll.current?(1.day.ago)}
  end

  def final
    @polls = if current_user.poll_officer?
               current_user.poll_officer.final_days_assigned_polls.select {|poll| poll.ends_at > 1.week.ago && poll.expired?}
             else
               []
             end
  end

end

{'fraction_non_alphanumeric': 0.11377777777777778, 'fraction_numerical': 0.0035555555555555557, 'mean_word_length': 3.7711864406779663, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6071658', 'n_tokens_mistral': 392, 'n_tokens_neox': 386, 'n_words': 64}