<commit_before>class Admin::SpendingProposalsController < Admin::BaseController
  include FeatureFlags
  feature_flag :spending_proposals

  has_filters %w{valuation_open without_admin managed valuating valuation_finished}, only: :index

  load_and_authorize_resource

  def index
    @spending_proposals = SpendingProposal.scoped_filter(params, @current_filter).order(created_at: :desc).page(params[:page])
  end

  def show
  end

  def edit
    @admins = Administrator.includes(:user).all
    @valuators = Valuator.includes(:user).all.order("description ASC").order("users.email ASC")
    @tags = ActsAsTaggableOn::Tag.spending_proposal_tags
  end

  def update
    if @spending_proposal.update(spending_proposal_params)
      path = admin_spending_proposal_path( @spending_proposal,
        { anchor: 'classification' }.merge(SpendingProposal.filter_params(params)))

      redirect_to path, notice: t("flash.actions.update.spending_proposal")
    else
      render :edit
    end<commit_msg>Makes redirect in spending proposal go back to the full page after editing<commit_after>class Admin::SpendingProposalsController < Admin::BaseController
  include FeatureFlags
  feature_flag :spending_proposals

  has_filters %w{valuation_open without_admin managed valuating valuation_finished}, only: :index

  load_and_authorize_resource

  def index
    @spending_proposals = SpendingProposal.scoped_filter(params, @current_filter).order(created_at: :desc).page(params[:page])
  end

  def show
  end

  def edit
    @admins = Administrator.includes(:user).all
    @valuators = Valuator.includes(:user).all.order("description ASC").order("users.email ASC")
    @tags = ActsAsTaggableOn::Tag.spending_proposal_tags
  end

  def update
    if @spending_proposal.update(spending_proposal_params)
      redirect_to admin_spending_proposal_path(@spending_proposal, SpendingProposal.filter_params(params)),
                  notice: t("flash.actions.update.spending_proposal")
    else
      render :edit
    end
{'fraction_non_alphanumeric': 0.0882793017456359, 'fraction_numerical': 0.0, 'mean_word_length': 5.078787878787879, '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': '6341454', 'n_tokens_mistral': 632, 'n_tokens_neox': 601, 'n_words': 116}