class Wco::Leadset

def self.list

def self.list
  [[nil,nil]] + all.map { |ttt| [ ttt.company_url, ttt.id ] }
end

def customer_id

def customer_id
  if self[:customer_id].blank?
    return nil if !email.present?
    existing = Stripe::Customer.search({ query: "email: '#{email}'" })
    # puts! existing, 'existing'
    if existing.data.present?
      update_attributes( customer_id: existing.data[0][:id] )
    else
      customer = Stripe::Customer.create({ email: email })
      # puts! customer, 'customer'
      update_attributes( customer_id: customer[:id] )
    end
  end
  self[:customer_id]
end

def next_serverhost

, inverse_of: :leadset
def next_serverhost
  serverhosts.first
end

def normalize_company_url

def normalize_company_url
  company_url.downcase!
end

def to_s

def to_s
  company_url
end