<commit_before>class Admin::EditorialRemarksController < Admin::BaseController
  before_filter :find_edition
  before_filter :enforce_permissions!
  before_filter :limit_edition_access!

  def enforce_permissions!
    enforce_permission!(:make_editorial_remark, @edition)
  end

  def new
    @editorial_remark = @edition.editorial_remarks.build
  end

  def create
    @editorial_remark = @edition.editorial_remarks.build(params[:editorial_remark].merge(author: current_user))
    if @editorial_remark.save
      redirect_to admin_edition_path(@edition)
    else
      render "new"
    end
  end

private
  def find_edition
    @edition = Edition.find(params[:edition_id])
  end
end<commit_msg>Add strong params for editorial remarks<commit_after>class Admin::EditorialRemarksController < Admin::BaseController
  before_filter :find_edition
  before_filter :enforce_permissions!
  before_filter :limit_edition_access!

  def enforce_permissions!
    enforce_permission!(:make_editorial_remark, @edition)
  end

  def new
    @editorial_remark = @edition.editorial_remarks.build
  end

  def create
    @editorial_remark = @edition.editorial_remarks.build(editorial_remark_params)
    if @editorial_remark.save
      redirect_to admin_edition_path(@edition)
    else
      render "new"
    end
  end

private
  def find_edition
    @edition = Edition.find(params[:edition_id])
  end

  def editorial_remark_params
    params.require(:editorial_remark).permit(:body).merge(author: current_user)
  end
end
{'fraction_non_alphanumeric': 0.07518296739853626, 'fraction_numerical': 0.0, 'mean_word_length': 4.944664031620554, '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': '6715456', 'n_tokens_mistral': 480, 'n_tokens_neox': 478, 'n_words': 88}