<commit_before>module SalesforceIntegration
  module Service
    class Order < Base

      def initialize(config)
        super("Order__c", config)
      end

      def find_id_by_email(email)
        results = salesforce.query("select Id from Order__c where Email__c = '#{email}'")
        results.any? ? results.first['Id'] : nil
      end

      def upsert!(email, attributes = {})
        contact_id = find_id_by_email(email)
        binding.pry
        contact_id.present? ? update!(attributes.merge({ Id: contact_id })) : create!(attributes)
      end

    end
  end
end<commit_msg>quick fix [#68800266]<commit_after>module SalesforceIntegration
  module Service
    class Order < Base

      def initialize(config)
        super("Order__c", config)
      end

      def find_id_by_email(email)
        results = salesforce.query("select Id from Order__c where Email__c = '#{email}'")
        results.any? ? results.first['Id'] : nil
      end

      def upsert!(email, attributes = {})
        contact_id = find_id_by_email(email)
        contact_id.present? ? update!(attributes.merge({ Id: contact_id })) : create!(attributes)
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.10652920962199312, 'fraction_numerical': 0.006872852233676976, 'mean_word_length': 2.794788273615635, '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': '814947', 'n_tokens_mistral': 354, 'n_tokens_neox': 341, 'n_words': 82}