<commit_before># frozen_string_literal: true

# workaround to get pagination right
RailsAdmin.config do |config|
  config.main_app_name = ['justask', 'Kontrollzentrum']
  config.parent_controller = '::ApplicationController'

  ## == Authentication ==
  config.authenticate_with do
    redirect_to main_app.root_path unless current_user&.has_role?(:administrator)
  end
  config.current_user_method(&:current_user)

  config.actions do
    dashboard                     # mandatory
    index                         # mandatory
    new
    export
    bulk_delete
    show
    edit
    delete
    show_in_app

    ## With an audit adapter, you can add:
    # history_index
    # history_show
  end

  config.included_models = %w[
    Answer
    Comment
    List
    ListMember
    Inbox
    MuteRule
    Notification
    Profile
    Question
    Relationship
    Report
    Service
    Services::Twitter
    Services::Tumblr
    Smile
    Theme
    User
  ]
end
<commit_msg>Add `UserBan` to Rails Admin<commit_after># frozen_string_literal: true

# workaround to get pagination right
RailsAdmin.config do |config|
  config.main_app_name = ['justask', 'Kontrollzentrum']
  config.parent_controller = '::ApplicationController'

  ## == Authentication ==
  config.authenticate_with do
    redirect_to main_app.root_path unless current_user&.has_role?(:administrator)
  end
  config.current_user_method(&:current_user)

  config.actions do
    dashboard                     # mandatory
    index                         # mandatory
    new
    export
    bulk_delete
    show
    edit
    delete
    show_in_app

    ## With an audit adapter, you can add:
    # history_index
    # history_show
  end

  config.included_models = %w[
    Answer
    Comment
    List
    ListMember
    Inbox
    MuteRule
    Notification
    Profile
    Question
    Relationship
    Report
    Service
    Services::Twitter
    Services::Tumblr
    Smile
    Theme
    User
    UserBan
  ]
end

{'fraction_non_alphanumeric': 0.06291222729578894, 'fraction_numerical': 0.0, 'mean_word_length': 2.471830985915493, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1864154', 'n_tokens_mistral': 603, 'n_tokens_neox': 577, 'n_words': 141}