<commit_before>class OrganizationsController < ApplicationController
  before_filter :load_resource, only: [:show, :edit, :update, :destroy]

  def new
    @organization = Organization.new
  end

  def index
    @organizations = Organization.all
  end

  def show
    @movements = @organization.
                 account.
                 movements.
                 order("created_at DESC").
                 page(params[:page]).
                 per(10)
  end

  def create
    @organization = Organization.new(organization_params)

    if @organization.save
      redirect_to @organization, status: :created
    else
      render action: :new, status: :unprocessable_entity
    end
  end

  def update
    if @organization.update_attributes(organization_params)
      redirect_to @organization
    else
      render action: :edit, status: :unprocessable_entity
    end
  end

  def destroy
    @organization.destroy
    redirect_to organizations_path, notice: "deleted"
  end

  def set_current
    if current_user
      session[:current_organization_id] = @organization.id
    end
    redirect_to root_path
  end

  private

  def load_resource
    @organization = Organization.find(params[:id])
  end

  def organization_params
    params[:organization].permit(*%w[name theme email phone web
                                     public_opening_times description address
                                     neighborhood city domain])
  end
end
<commit_msg>Doc++<commit_after>class OrganizationsController < ApplicationController
  before_filter :load_resource, only: [:show, :edit, :update, :destroy]

  def new
    @organization = Organization.new
  end

  def index
    @organizations = Organization.all
  end

  def show
    @movements = @organization.
                 account.
                 movements.
                 order("created_at DESC").
                 page(params[:page]).
                 per(10)
  end

  def create
    @organization = Organization.new(organization_params)

    if @organization.save
      redirect_to @organization, status: :created
    else
      render action: :new, status: :unprocessable_entity
    end
  end

  def update
    if @organization.update_attributes(organization_params)
      redirect_to @organization
    else
      render action: :edit, status: :unprocessable_entity
    end
  end

  def destroy
    @organization.destroy
    redirect_to organizations_path, notice: "deleted"
  end

  # POST /organizations/:organization_id/set_current
  #
  def set_current
    if current_user
      session[:current_organization_id] = @organization.id
    end
    redirect_to root_path
  end

  private

  def load_resource
    @organization = Organization.find(params[:id])
  end

  def organization_params
    params[:organization].permit(*%w[name theme email phone web
                                     public_opening_times description address
                                     neighborhood city domain])
  end
end

{'fraction_non_alphanumeric': 0.06799057556378324, 'fraction_numerical': 0.0013463480309660047, 'mean_word_length': 2.40045766590389, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2639468', 'n_tokens_mistral': 818, 'n_tokens_neox': 764, 'n_words': 206}