<commit_before># frozen_string_literal: true

class UnfollowService < BaseService
  # Unfollow and notify the remote user
  # @param [Account] source_account Where to unfollow from
  # @param [Account] target_account Which to unfollow
  def call(source_account, target_account)
    follow = source_account.unfollow!(target_account)
    NotificationWorker.perform_async(build_xml(follow), source_account.id, target_account.id) unless target_account.local?
    UnmergeWorker.perform_async(target_account.id, source_account.id)
  end

  private

  def build_xml(follow)
    AtomSerializer.render(AtomSerializer.new.unfollow_salmon(follow))
  end
end<commit_msg>Fixed NoMethodError in UnfollowService (#1918)<commit_after># frozen_string_literal: true

class UnfollowService < BaseService
  # Unfollow and notify the remote user
  # @param [Account] source_account Where to unfollow from
  # @param [Account] target_account Which to unfollow
  def call(source_account, target_account)
    follow = source_account.unfollow!(target_account)
    return unless follow
    NotificationWorker.perform_async(build_xml(follow), source_account.id, target_account.id) unless target_account.local?
    UnmergeWorker.perform_async(target_account.id, source_account.id)
  end

  private

  def build_xml(follow)
    AtomSerializer.render(AtomSerializer.new.unfollow_salmon(follow))
  end
end
{'fraction_non_alphanumeric': 0.0735080058224163, 'fraction_numerical': 0.002911208151382824, 'mean_word_length': 5.875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4603702', 'n_tokens_mistral': 410, 'n_tokens_neox': 398, 'n_words': 94}