<commit_before>class Ad::PublicationsController < ApplicationController

  layout "ad"

  before_action :set_publication, only: [:show, :edit, :update, :destroy]

  def index
    @publications = Publication.all
  end

  def new
    @publication = Publication.new
  end

  def create
    @publication = Publication.new(params_publication)
    if @publication.save
      redirect_to [:ad, @publication], notice: 'Publicação criada com sucesso.'
    else
      render :new
    end
  end

  def show
  end

  def edit
  end

  def update
  end

  def destroy
  end

  private

  def set_publication
    @publication = Publication.find(params[:id])
  end

  def params_publication
    params.require(:publication).permit(
      :title,
      :description,
      :archive,
      :status,
      :page,
      :link,
      :vehicle_id
    )
  end
end<commit_msg>config all actions to resource<commit_after>class Ad::PublicationsController < ApplicationController

  layout "ad"

  before_action :set_publication, only: [:show, :edit, :update, :destroy]

  def index
    @publications = Publication.all
  end

  def new
    @publication = Publication.new
  end

  def create
    @publication = Publication.new(params_publication)
    if @publication.save
      redirect_to [:ad, @publication], notice: 'Publicação criada com sucesso.'
    else
      render :new
    end
  end

  def show
  end

  def edit
  end

  def update
    if @publication.update(params_publication)
      redirect_to [:ad, @publication], notice: 'Publicação atualizada com sucesso!'
    else
      render :edit
    end
  end

  def destroy
    @publication.destroy
    redirect_to ad_publications_path, notice: 'Publicação removida com sucesso.'
  end

  private

  def set_publication
    @publication = Publication.find(params[:id])
  end

  def params_publication
    params.require(:publication).permit(
      :title,
      :description,
      :archive,
      :status,
      :page,
      :link,
      :vehicle_id
    )
  end
end
{'fraction_non_alphanumeric': 0.08316633266533066, 'fraction_numerical': 0.0, 'mean_word_length': 2.8552123552123554, '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': '1360384', 'n_tokens_mistral': 652, 'n_tokens_neox': 617, 'n_words': 167}