<commit_before># config/initializers/resque_mailer.rb
Resque::Mailer.excluded_environments = [:test]

module Devise
  module Mailers
    module Helpers
      def initialize_from_record(user_hash_or_object)
        user = get_user_for_hash_or_object(user_hash_or_object)
        @scope_name = Devise::Mapping.find_scope!(user)
        @resource   = instance_variable_set("@#{devise_mapping.name}", user)
      end

      def get_user_for_hash_or_object(hash_or_object)
        if hash_or_object.kind_of?(Hash)
          User.where(email: hash_or_object['email']).first
        else
          hash_or_object
        end
      end
    end
  end
end

Resque::Mailer.default_queue_name = "bbb_mailer"<commit_msg>User's json serialization changed, this fixes it for resque devise mailer<commit_after># config/initializers/resque_mailer.rb
Resque::Mailer.excluded_environments = [:test]

module Devise
  module Mailers
    module Helpers
      def initialize_from_record(user_hash_or_object)
        user = get_user_for_hash_or_object(user_hash_or_object)
        @scope_name = Devise::Mapping.find_scope!(user)
        @resource   = instance_variable_set("@#{devise_mapping.name}", user)
      end

      def get_user_for_hash_or_object(hash_or_object)
        if hash_or_object.kind_of?(Hash)
          User.where(email: hash_or_object['user']['email']).first
        else
          hash_or_object
        end
      end
    end
  end
end

Resque::Mailer.default_queue_name = "bbb_mailer"
{'fraction_non_alphanumeric': 0.08502024291497975, 'fraction_numerical': 0.0, 'mean_word_length': 3.5351681957186543, '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': '239269', 'n_tokens_mistral': 497, 'n_tokens_neox': 495, 'n_words': 79}