<commit_before># frozen_string_literal: true

class Settings::NotificationsController < ApplicationController
  layout 'admin'

  before_action :authenticate_user!

  def show; end

  def update
    user_settings.update(user_settings_params.to_h)

    if current_user.save
      redirect_to settings_notifications_path, notice: I18n.t('generic.changes_saved_msg')
    else
      render :show
    end
  end

  private

  def user_settings
    UserSettingsDecorator.new(current_user)
  end

  def user_settings_params
    params.require(:user).permit(
      notification_emails: %i(follow follow_request reblog favourite mention digest),
      interactions: %i(must_be_follower must_be_following must_be_following_dm)
    )
  end
end<commit_msg>Whitelist report notification param in Settings::NotificationsController (#8560)<commit_after># frozen_string_literal: true

class Settings::NotificationsController < ApplicationController
  layout 'admin'

  before_action :authenticate_user!

  def show; end

  def update
    user_settings.update(user_settings_params.to_h)

    if current_user.save
      redirect_to settings_notifications_path, notice: I18n.t('generic.changes_saved_msg')
    else
      render :show
    end
  end

  private

  def user_settings
    UserSettingsDecorator.new(current_user)
  end

  def user_settings_params
    params.require(:user).permit(
      notification_emails: %i(follow follow_request reblog favourite mention digest report),
      interactions: %i(must_be_follower must_be_following must_be_following_dm)
    )
  end
end
{'fraction_non_alphanumeric': 0.06217948717948718, 'fraction_numerical': 0.005128205128205128, 'mean_word_length': 4.535460992907802, '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': '3309318', 'n_tokens_mistral': 486, 'n_tokens_neox': 458, 'n_words': 102}