<commit_before>require_dependency "financial/application_controller"

module Financial
  class MortgageAdjustmentsController < ApplicationController
    #update or create a new adjustment if an adjustment already exist for the given month, update it
    def create
      @adjustment = MortgageAdj.where(:mortgage_id=>params[:adjustment][:mortgage_id],:month=>params[:adjustment][:month]).first
      if @adjustment.blank?
        @adjustment = MortgageAdj.new(params[:adjustment])
      else
        @adjustment.attributes=params[:adjustment]
      end
      
      if @adjustment.save
        @adjustment=MortgageAdjustment.new
      end

      @budget = Mortgage.where(:id=>params[:adjustment][:mortgage_id]).first.budget
      render "financial/budgets/update_detail"
    end

    def destroy
      existing_adj = MortgageAdj.find(params[:id])
      existing_adj.destroy
      redirect_to :controller=>:budgets, :action=>:show, :id=>existing_adj.mortgage_id
    end
  end
end
<commit_msg>issue_58: fix typo in mortgage adj class name<commit_after>require_dependency "financial/application_controller"

module Financial
  class MortgageAdjustmentsController < ApplicationController
    #update or create a new adjustment if an adjustment already exist for the given month, update it
    def create
      @adjustment = MortgageAdj.where(:mortgage_id=>params[:adjustment][:mortgage_id],:month=>params[:adjustment][:month]).first
      if @adjustment.blank?
        @adjustment = MortgageAdj.new(params[:adjustment])
      else
        @adjustment.attributes=params[:adjustment]
      end
      
      if @adjustment.save
        @adjustment=MortgageAdj.new
      end

      @budget = Mortgage.where(:id=>params[:adjustment][:mortgage_id]).first.budget
      render "financial/budgets/update_detail"
    end

    def destroy
      existing_adj = MortgageAdj.find(params[:id])
      existing_adj.destroy
      redirect_to :controller=>:budgets, :action=>:show, :id=>existing_adj.mortgage_id
    end
  end
end

{'fraction_non_alphanumeric': 0.0981564524165421, 'fraction_numerical': 0.000996512207274539, 'mean_word_length': 3.897560975609756, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '676037', 'n_tokens_mistral': 597, 'n_tokens_neox': 567, 'n_words': 119}