Sha256: 9e0bafc01346b6db206c4809b52344bb40c410dff83d3760d5a2e04fc9738fb5

Contents?: true

Size: 1.09 KB

Versions: 11

Compression:

Stored size: 1.09 KB

Contents

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

  store_in :collection => 'ish_lead'

  belongs_to :profile, :class_name => 'IshModels::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 :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

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ish_models-0.0.33.75 lib/ish/lead.rb
ish_models-0.0.33.74 lib/ish/lead.rb
ish_models-0.0.33.73 lib/ish/lead.rb
ish_models-0.0.33.71 lib/ish/lead.rb
ish_models-0.0.33.70 lib/ish/lead.rb
ish_models-0.0.33.69 lib/ish/lead.rb
ish_models-0.0.33.68 lib/ish/lead.rb
ish_models-0.0.33.67 lib/ish/lead.rb
ish_models-0.0.33.66 lib/ish/lead.rb
ish_models-0.0.33.65 lib/ish/lead.rb
ish_models-0.0.33.64 lib/ish/lead.rb