<commit_before>class NewsItemsController < ApplicationController

  before_filter :find_latest_news_items, :find_page
  before_filter :find_published_news_items, :find_page, :only => [:index]
  before_filter :find_news_item, :only => [:show]

  def index
    render 'index'
  end

  def show
    render 'show'
  end

protected

  def find_latest_news_items
    @news_items = NewsItem.latest.paginate(:page => params[:page]) # 10 items
  end

  def find_published_news_items
    @news_items = NewsItem.published.paginate(:page => params[:page])
  end
<commit_msg>fixed before_filters so that @page is loaded properly for both :index and :show actions.<commit_after>class NewsItemsController < ApplicationController
  before_filter :find_page
  before_filter :find_published_news_items, :only => [:index]
  before_filter :find_news_item, :find_latest_news_items, :only => [:show]

  def index
    render 'index'
  end

  def show
    render 'show'
  end

protected

  def find_latest_news_items
    @news_items = NewsItem.latest.paginate(:page => params[:page]) # 10 items
  end

  def find_published_news_items
    @news_items = NewsItem.published.paginate(:page => params[:page])
  end

{'fraction_non_alphanumeric': 0.09274873524451939, 'fraction_numerical': 0.003372681281618887, 'mean_word_length': 4.790243902439024, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '5817892', 'n_tokens_mistral': 385, 'n_tokens_neox': 371, 'n_words': 92}