<commit_before>class ProjectsController < ApplicationController
  before_filter :new_project, :only => :create
  before_filter :load_users, :only => [:edit,:update,:create,:new]
  load_and_authorize_resource
  def index

  end
  def create
    @users = User.where(:active => true)
    if @project.save
      redirect_to projects_path
    else
      render :new
    end
  end
  def new
    @project.owner = current_user
  end
  def destroy
    @project.destroy
    redirect_to :back
  end
  def update
    @project.update(project_params)
    if @project.save
      redirect_to projects_path
    else
      render :edit
    end
  end
private
  def project_params
    if current_user.admin or @project.owner == current_user
      params.require(:project).permit(:name, :owner_id, :default_feature_list)
    else
      params.require(:project).permit(:name, :default_feature_list)
    end<commit_msg>missing permit params<commit_after>class ProjectsController < ApplicationController
  before_filter :new_project, :only => :create
  before_filter :load_users, :only => [:edit,:update,:create,:new]
  load_and_authorize_resource
  def index

  end
  def create
    @users = User.where(:active => true)
    if @project.save
      redirect_to projects_path
    else
      render :new
    end
  end
  def new
    @project.owner = current_user
  end
  def destroy
    @project.destroy
    redirect_to :back
  end
  def update
    @project.update(project_params)
    if @project.save
      redirect_to projects_path
    else
      render :edit
    end
  end
private
  def project_params
    if current_user.admin or @project.owner == current_user
      params.require(:project).permit(:name, :owner_id, :feature_list)
    else
      params.require(:project).permit(:name, :feature_list)
    end
{'fraction_non_alphanumeric': 0.08408071748878924, 'fraction_numerical': 0.0, 'mean_word_length': 3.3012048192771086, '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': '5092777', 'n_tokens_mistral': 553, 'n_tokens_neox': 548, 'n_words': 135}