<commit_before>class LedgersController < ApplicationController
  before_filter :company_required
  before_filter :load_ledger, :only => [:show, :edit, :update, :destroy]
  before_filter :right_company, :only => [:show, :edit, :update, :destroy]

  def load_ledger
    @ledger = Ledger.find(params[:id])

    if params[:account_id] && params[:account_id].to_i != 0
      raise "account_id incorrect" if @ledger.account_id != params[:account_id].to_i
    end
  end

  def right_company
    if @me.companies.include? @ledger.company
      @me.current_company = @ledger.company
      return true
    end

    flash[:notice]='You can only manage your own ledgers. Go away.'
    redirect_to :action => "index"
    return false 
  end<commit_msg>bugfix<commit_after>class LedgersController < ApplicationController
  before_filter :company_required
  before_filter :load_ledger, :only => [:show, :edit, :update, :destroy]
  before_filter :right_company, :only => [:show, :edit, :update, :destroy]

  def load_ledger
    @ledger = Ledger.find(params[:id])

    if params[:account_id] && params[:account_id].to_i != 0
      raise "account_id incorrect" if @ledger.account_id != params[:account_id].to_i
    end
  end

  def right_company
    if @me.companies.include? @ledger.account.company
      @me.current_company = @ledger.account.company
      return true
    end

    flash[:notice]='You can only manage your own ledgers. Go away.'
    redirect_to :action => "index"
    return false 
  end
{'fraction_non_alphanumeric': 0.11701412239408204, 'fraction_numerical': 0.0013449899125756557, 'mean_word_length': 3.9765886287625416, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5883892', 'n_tokens_mistral': 486, 'n_tokens_neox': 471, 'n_words': 119}