<commit_before>class GuidanceGroupsController < ApplicationController


  # GET /guidance_groups/1
  # GET /guidance_groups/1.json
  def admin_show
    @guidance_group = GuidanceGroup.find(params[:id])
    authorize @guidance_group
    respond_to do |format|
      format.html
      format.json { render json: @guidance_group }
    end
  end


	# GET add new guidance groups
	def admin_new
    @guidance_group = GuidanceGroup.new
    authorize @guidance_group
    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @guidance }
    end
	end


  # POST /guidance_groups
  # POST /guidance_groups.json
  def admin_create
    @guidance_group = GuidanceGroup.new(params[:guidance_group])
    authorize @guidance_group
    @guidance_group.organisation_id = current_user.organisation_id
      if params[:save_publish]
          @guidance_group.published = true
      end

    respond_to do |format|
      if @guidance_group.save
        format.html { redirect_to admin_index_guidance_path, notice: I18n.t('org_admin.guidance_group.created_message') }
        format.json { render json: @guidance_group, status: :created, location: @guidance_group }
      else
        format.html { render action: "new" }
        format.json { render json: @guidance_group.errors, status: :unprocessable_entity }
      end
    end
  end


  # GET /guidance_groups/1/edit
  def admin_edit
      @guidance_group = GuidanceGroup.find(params[:id])
      authorize @guidance_group
  end


  # PUT /guidance_groups/1
  # PUT /guidance_groups/1.json
  def admin_update
 		@guidance_group = GuidanceGroup.find(params[:id])
    authorize @guidance_group
    @guidance_group.organisation_id = current_user.organisation_id
    respond_to do |format|
      if @guidance_group.update_attributes(params[:guidance_group])
        format.html { redirect_to admin_index_guidance_path(params[:guidance_group]), notice: I18n.t('org_admin.guidance_group.updated_message') }
        format.json { head :no_content }
      else
        format.html { render action: "edit" }
        format.json { render json: @guidance_group.errors, status: :unprocessable_entity }
      end
    end
  end


  # PUT /guidance_groups/1
  def admin_update_publish
 		@guidance_group = GuidanceGroup.find(params[:id])
    authorize @guidance_group
    @guidance_group.organisation_id = current_user.organisation_id
      @guidance_group.published = true

    respond_to do |format|
      if @guidance_group.update_attributes(params[:guidance_group])
        format.html { redirect_to admin_index_guidance_path(params[:guidance_group]), notice: I18n.t('org_admin.guidance_group.updated_message') }
        format.json { head :no_content }
      else
        format.html { render action: "edit" }
        format.json { render json: @guidance_group.errors, status: :unprocessable_entity }
      end
    end
  end


  # DELETE /guidance_groups/1
  # DELETE /guidance_groups/1.json
  def admin_destroy
   	@guidance_group = GuidanceGroup.find(params[:id])
    authorize @guidance_group
    @guidance_group.destroy
    respond_to do |format|
      format.html { redirect_to admin_index_guidance_path, notice: I18n.t('org_admin.guidance_group.destroyed_message') }
      format.json { head :no_content }
    end
	end

end<commit_msg>removed json and forced authentication on guidance_groups<commit_after>class GuidanceGroupsController < ApplicationController
  after_action :verify_authorized

  # GET /guidance_groups/1
  def admin_show
    @guidance_group = GuidanceGroup.find(params[:id])
    authorize @guidance_group
    respond_to do |format|
      format.html
    end
  end


	# GET add new guidance groups
	def admin_new
    @guidance_group = GuidanceGroup.new
    authorize @guidance_group
    respond_to do |format|
      format.html # new.html.erb
    end
	end


  # POST /guidance_groups
  # POST /guidance_groups.json
  def admin_create
    @guidance_group = GuidanceGroup.new(params[:guidance_group])
    authorize @guidance_group
    @guidance_group.organisation_id = current_user.organisation_id
      if params[:save_publish]
          @guidance_group.published = true
      end

    respond_to do |format|
      if @guidance_group.save
        format.html { redirect_to admin_index_guidance_path, notice: I18n.t('org_admin.guidance_group.created_message') }
      else
        format.html { render action: "new" }
      end
    end
  end


  # GET /guidance_groups/1/edit
  def admin_edit
      @guidance_group = GuidanceGroup.find(params[:id])
      authorize @guidance_group
  end


  # PUT /guidance_groups/1
  def admin_update
 		@guidance_group = GuidanceGroup.find(params[:id])
    authorize @guidance_group
    @guidance_group.organisation_id = current_user.organisation_id
    respond_to do |format|
      if @guidance_group.update_attributes(params[:guidance_group])
        format.html { redirect_to admin_index_guidance_path(params[:guidance_group]), notice: I18n.t('org_admin.guidance_group.updated_message') }
      else
        format.html { render action: "edit" }
      end
    end
  end


  # PUT /guidance_groups/1
  def admin_update_publish
 		@guidance_group = GuidanceGroup.find(params[:id])
    authorize @guidance_group
    @guidance_group.organisation_id = current_user.organisation_id
      @guidance_group.published = true

    respond_to do |format|
      if @guidance_group.update_attributes(params[:guidance_group])
        format.html { redirect_to admin_index_guidance_path(params[:guidance_group]), notice: I18n.t('org_admin.guidance_group.updated_message') }
      else
        format.html { render action: "edit" }
      end
    end
  end


  # DELETE /guidance_groups/1
  # DELETE /guidance_groups/1.json
  def admin_destroy
   	@guidance_group = GuidanceGroup.find(params[:id])
    authorize @guidance_group
    @guidance_group.destroy
    respond_to do |format|
      format.html { redirect_to admin_index_guidance_path, notice: I18n.t('org_admin.guidance_group.destroyed_message') }
    end
	end

end
{'fraction_non_alphanumeric': 0.08453745225045674, 'fraction_numerical': 0.004982561036372696, 'mean_word_length': 3.5244177310293012, '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': '2226004', 'n_tokens_mistral': 1984, 'n_tokens_neox': 1921, 'n_words': 372}