<commit_before>require 'observer'

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  has_many :articles
  has_many :comments
  geocoded_by :current_sign_in_ip   # can also be a street address
  before_save :geocode  # auto-fetch coordinates when user logs in
  acts_as_follower
  acts_as_messageable
  extend FriendlyId
  friendly_id :slug_candidates, use: [:slugged, :finders]
  after_validation :add_to_mailchimp

  def mailboxer_name
    self.name
  end

  def mailboxer_email(object)
    self.email
  end

  def slug_candidates
    [
      :name,
      [:name, :id]
    ]
  end

  def add_to_mailchimp
    if self.subscribed?
      gb = Gibbon::Request.new
      gb.lists.subscribe({:id => ENV['MAILCHIMP_LIST_ID'], :email => {:email => "#{self.email}"}, :merge_vars => {:FNAME => "#{self.name}"}})
    end<commit_msg>Removed geocoding for the time being<commit_after>require 'observer'

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  has_many :articles
  has_many :comments
  acts_as_follower
  acts_as_messageable
  extend FriendlyId
  friendly_id :slug_candidates, use: [:slugged, :finders]
  after_validation :add_to_mailchimp

  def mailboxer_name
    self.name
  end

  def mailboxer_email(object)
    self.email
  end

  def slug_candidates
    [
      :name,
      [:name, :id]
    ]
  end

  def add_to_mailchimp
    if self.subscribed?
      gb = Gibbon::Request.new
      gb.lists.subscribe({:id => ENV['MAILCHIMP_LIST_ID'], :email => {:email => "#{self.email}"}, :merge_vars => {:FNAME => "#{self.name}"}})
    end
{'fraction_non_alphanumeric': 0.10625317742755465, 'fraction_numerical': 0.0, 'mean_word_length': 3.92, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4288385', 'n_tokens_mistral': 695, 'n_tokens_neox': 658, 'n_words': 156}