<commit_before>ActiveAdmin.register User do

  filter :name
  filter :email
  #filter :approved, :as => :select
  filter :student, :as => :select

  actions :index, :show, :new, :create, :update, :edit

  index do
    selectable_column
    column :name
    column :email
    bcolumn :admin
    #bcolumn :unapproved
    bcolumn :student
    bcolumn :member
    #column :current_sign_in_at
    #column :last_sign_in_at
    column :sign_in_count
    default_actions
  end

  form do |f|
    f.inputs "User Details" do
      f.input :name
      f.input :email
      if f.object.new_record?
        f.input :password
        f.input :password_confirmation
        f.input :approved, :as => :boolean
      end
      f.input :student, :as => :boolean
      f.input :member, :as => :boolean
      f.input :company
      f.input :position
      f.input :representative, :as => :boolean
    end
    f.actions
  end

  member_action :approve, :method => :put do
    user = User.find(params[:id])
    user.approve!
    if user.save
      redirect_to({:action => :show}, :notice => t("flash.approved"))
    else
      redirect_to({:action => :show}, :warn => t("flash.error"))
    end
  end

  member_action :lock, :method => :put do
    user = User.find(params[:id])<commit_msg>Possibly fixing user create on admin panel.<commit_after>ActiveAdmin.register User do

  filter :name
  filter :email
  #filter :approved, :as => :select
  filter :student, :as => :select

  actions :index, :show, :new, :create, :update, :edit

  index do
    selectable_column
    column :name
    column :email
    bcolumn :admin
    #bcolumn :unapproved
    bcolumn :student
    bcolumn :member
    #column :current_sign_in_at
    #column :last_sign_in_at
    column :sign_in_count
    default_actions
  end

  form do |f|
    f.inputs "User Details" do
      f.input :name
      f.input :email
      if f.object.new_record?
        f.input :password
        f.input :password_confirmation
        #f.input :approved, :as => :boolean
      end
      f.input :student, :as => :boolean
      f.input :member, :as => :boolean
      f.input :company
      f.input :position
      f.input :representative, :as => :boolean
    end
    f.actions
  end

  member_action :approve, :method => :put do
    user = User.find(params[:id])
    user.approve!
    if user.save
      redirect_to({:action => :show}, :notice => t("flash.approved"))
    else
      redirect_to({:action => :show}, :warn => t("flash.error"))
    end
  end

  member_action :lock, :method => :put do
    user = User.find(params[:id])
{'fraction_non_alphanumeric': 0.12095200936402653, 'fraction_numerical': 0.0, 'mean_word_length': 2.6420454545454546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '4694460', 'n_tokens_mistral': 854, 'n_tokens_neox': 830, 'n_words': 233}