Sha256: 3d0be251891e3e6ae157965918d1e7896f3b37f9628ad8a4cb0dd6b8d80632e9

Contents?: true

Size: 1.3 KB

Versions: 10

Compression:

Stored size: 1.3 KB

Contents

#
# Lead
# _vp_ 20171204
#
class Ish::Lead
  include Mongoid::Document
  include Mongoid::Timestamps

  store_in :collection => 'ish_leads'

  belongs_to :profile, :class_name => '::Ish::UserProfile'

  has_and_belongs_to_many :campaigns,             :class_name => '::Ish::Campaign', :inverse_of => :leads
  has_and_belongs_to_many :unsubscribe_campaigns, :class_name => '::Ish::Campaign', :inverse_of => :unsubscribe_leads

  field :email
  field :job_url
  field :company_url
  field :website_html
  field :yelp_url

  field :company
  validates_uniqueness_of :company
  index({ :company => -1 })

  field :description

  STATES = %w( considering applied )
  field :state, :type => String

  field :is_done,  :type => Boolean, :default => false
  field :is_trash, :type => Boolean, :default => false

  field :applied_on, :type => Time

  field :tag, :type => String # 'hired_com_ror', not enumerated for now _vp_ 20180103
  field :location

  field :raw_phone, :type => String
  def phone= which
    write_attribute :raw_phone, which
    write_attribute :phone, which.gsub(/\D/, '').to_i
  end
  field :phone, :type => Integer
  field :address, :type => String

  # If I crawl on 20180724, I add "20180724" here, so I don't crawl in the same way again.
  field :extra, :type => Array, :default => []

end

Lead = Ish::Lead

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ish_models-0.0.33.175 lib/ish/lead.rb
ish_models-0.0.33.174 lib/ish/lead.rb
ish_models-0.0.33.173 lib/ish/lead.rb
ish_models-0.0.33.172 lib/ish/lead.rb
ish_models-0.0.33.170 lib/ish/lead.rb
ish_models-0.0.33.169 lib/ish/lead.rb
ish_models-0.0.33.168 lib/ish/lead.rb
ish_models-0.0.33.167 lib/ish/lead.rb
ish_models-0.0.33.166 lib/ish/lead.rb
ish_models-0.0.33.164 lib/ish/lead.rb