<commit_before>class NewsItemsController < ApplicationController
  before_filter :authorize_user_is_admin

  def index
    @news = paginate(NewsItem.all)
  end

  def new
    @news = NewsItem.new
  end

  def create
    @news = NewsItem.create(params[:news])
    
    if @news.valid?
      flash['notice'] = 'NewsItem was successfully created.'
      redirect_to news_items_path<commit_msg>paginate requires a Relation<commit_after>class NewsItemsController < ApplicationController
  before_filter :authorize_user_is_admin

  def index
    @news = paginate(NewsItem.scoped)
  end

  def new
    @news = NewsItem.new
  end

  def create
    @news = NewsItem.create(params[:news])
    
    if @news.valid?
      flash['notice'] = 'NewsItem was successfully created.'
      redirect_to news_items_path
{'fraction_non_alphanumeric': 0.08020050125313283, 'fraction_numerical': 0.0, 'mean_word_length': 3.5919540229885056, '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': '2220579', 'n_tokens_mistral': 247, 'n_tokens_neox': 240, 'n_words': 58}