<commit_before>if Spree.user_class
  Spree.user_class.class_eval do
    after_create  :subscribe
    around_update :resubscribe
    after_destroy :unsubscribe
    after_initialize :assign_subscription_default

    delegate :subscribe, :resubscribe, :unsubscribe, to: :subscription


    def first_name
      shipping_address.firstname
    end

    def last_name
      shipping_address.lastname
    end

    def country
      shipping_address.country.name
    end

  private
    def subscription
      Spree::Chimpy::Subscription.new(self)
    end

    def assign_subscription_default
      self.subscribed = Spree::Chimpy::Config.subscribed_by_default if new_record?
    end
  end
end<commit_msg>Adding city and source methods to the User Decorator<commit_after>if Spree.user_class
  Spree.user_class.class_eval do
    after_create  :subscribe
    around_update :resubscribe
    after_destroy :unsubscribe
    after_initialize :assign_subscription_default

    delegate :subscribe, :resubscribe, :unsubscribe, to: :subscription


    def first_name
      shipping_address.firstname
    end

    def last_name
      shipping_address.lastname
    end

    def country
      shipping_address.country.name
    end

    def city
      shipping_address.country.name
    end

    def source
      MailchimpSubscriber.where(email: email).first.source
    end

  private
    def subscription
      Spree::Chimpy::Subscription.new(self)
    end

    def assign_subscription_default
      self.subscribed = Spree::Chimpy::Config.subscribed_by_default if new_record?
    end
  end
end
{'fraction_non_alphanumeric': 0.05216284987277354, 'fraction_numerical': 0.0, 'mean_word_length': 3.2628726287262872, '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': '4872121', 'n_tokens_mistral': 470, 'n_tokens_neox': 467, 'n_words': 104}