Sha256: ef57928774e0a30ac9220e43d61ea45cddb6b9f6da557f894c4d2888d172366a

Contents?: true

Size: 1.28 KB

Versions: 22

Compression:

Stored size: 1.28 KB

Contents

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

  store_in :collection => 'ish_lead'

  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

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ish_models-0.0.33.163 lib/ish/lead.rb
ish_models-0.0.33.162 lib/ish/lead.rb
ish_models-0.0.33.161 lib/ish/lead.rb
ish_models-0.0.33.160 lib/ish/lead.rb
ish_models-0.0.33.159 lib/ish/lead.rb
ish_models-0.0.33.158 lib/ish/lead.rb
ish_models-0.0.33.157 lib/ish/lead.rb
ish_models-0.0.33.156 lib/ish/lead.rb
ish_models-0.0.33.154 lib/ish/lead.rb
ish_models-0.0.33.153 lib/ish/lead.rb
ish_models-0.0.33.152 lib/ish/lead.rb
ish_models-0.0.33.151 lib/ish/lead.rb
ish_models-0.0.33.150 lib/ish/lead.rb
ish_models-0.0.33.149 lib/ish/lead.rb
ish_models-0.0.33.148 lib/ish/lead.rb
ish_models-0.0.33.147 lib/ish/lead.rb
ish_models-0.0.33.146 lib/ish/lead.rb
ish_models-0.0.33.145 lib/ish/lead.rb
ish_models-0.0.33.144 lib/ish/lead.rb
ish_models-0.0.33.143 lib/ish/lead.rb