<commit_before>module Metova
  module Devise
    module Controller
      extend ActiveSupport::Concern

      included do
        respond_to :json
        before_action :accept_user_param_root!
        self.responder = Metova::Responder
      end

      def accept_user_param_root!
        params[:api_user] = params[:user] if params[:user] && !params[:api_user]
      end

    end
  end
end<commit_msg>Override devise_mapping to get rid of api_ prefix on namespace'd devise_for calls<commit_after>module Metova
  module Devise
    module Controller
      extend ActiveSupport::Concern

      included do
        respond_to :json
        self.responder = Metova::Responder
      end

      def devise_mapping
        @_devise_mapping ||= ::Devise.mappings[super.singular.to_s.gsub('api_', '').intern]
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.07237635705669482, 'fraction_numerical': 0.0, 'mean_word_length': 2.772727272727273, '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': '3928328', 'n_tokens_mistral': 255, 'n_tokens_neox': 239, 'n_words': 62}