<commit_before># frozen_string_literal: true
class User::MasqueradesController < Devise::MasqueradesController
  before_action :load_and_authorize_user, except: [:back]

  private

  def id_param
    params.permit(:id)[:id]
  end

  def load_and_authorize_user
    @user = User.find(id_param)
    authorize!(:masquerade, @user)
  end
end
<commit_msg>fix masquerade test case<commit_after># frozen_string_literal: true
class User::MasqueradesController < Devise::MasqueradesController
  before_action :load_and_authorize_user, except: [:back]

  private

  def id_param
    params.permit(:id)[:id]
  end

  def load_and_authorize_user
    @user = User.find(id_param)
    authorize!(:masquerade, @user)
  end

  def find_resource
    masqueraded_resource_class.find(id_param)
  end
end

{'fraction_non_alphanumeric': 0.09056122448979592, 'fraction_numerical': 0.0, 'mean_word_length': 5.23015873015873, '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': '7580807', 'n_tokens_mistral': 282, 'n_tokens_neox': 270, 'n_words': 53}