<commit_before>module Users
  module UpdatingService
    include BaseService

    def call(user, params, flash)
      user.transaction do
        user.assign_attributes(params)

        send_confirmation_email(user, flash) if user.email_changed? && !user.email.blank?

        user.save || rollback!
      end
    end

    private

    def send_confirmation_email(user, flash)
      user.generate_confirmation_token
      UserMailer.confirmation(user).deliver

      flash[:notice] = "Sent confirmation email to #{user.email}"
    end
  end
end<commit_msg>Fixed test for Users::UpdatingService<commit_after>module Users
  module UpdatingService
    include BaseService

    def call(user, params, flash = {})
      user.transaction do
        user.assign_attributes(params)

        send_confirmation_email(user, flash) if user.email_changed? && !user.email.blank?

        user.save || rollback!
      end
    end

    private

    def send_confirmation_email(user, flash)
      user.generate_confirmation_token
      UserMailer.confirmation(user).deliver

      flash[:notice] = "Sent confirmation email to #{user.email}"
    end
  end
end
{'fraction_non_alphanumeric': 0.08150744960560911, 'fraction_numerical': 0.0, 'mean_word_length': 3.0785714285714287, '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': '1067032', 'n_tokens_mistral': 333, 'n_tokens_neox': 321, 'n_words': 76}