2017-12-21 19:41:50 +00:00
|
|
|
class EmployerProfile
|
|
|
|
include Mongoid::Document
|
|
|
|
include Mongoid::Timestamps
|
|
|
|
|
|
|
|
field :company_name, localize: true
|
|
|
|
field :contact_person, localize: true
|
|
|
|
field :office_address, localize: true
|
|
|
|
field :company_profile, localize: true
|
|
|
|
field :website
|
|
|
|
field :country
|
|
|
|
field :state
|
|
|
|
field :city
|
|
|
|
field :zipcode
|
|
|
|
field :country_code
|
|
|
|
field :phone_number
|
|
|
|
field :mobile_number
|
2017-12-26 13:07:35 +00:00
|
|
|
field :industry
|
2017-12-21 19:41:50 +00:00
|
|
|
|
|
|
|
mount_uploader :avatar, ImageUploader
|
|
|
|
|
|
|
|
belongs_to :recruit_profile
|
|
|
|
has_many :recruitment_jobs, :dependent => :destroy
|
|
|
|
|
2017-12-29 12:00:33 +00:00
|
|
|
def get_avatar
|
|
|
|
if self.avatar.url.nil?
|
|
|
|
return "/assets/person.png"
|
|
|
|
else
|
|
|
|
return self.avatar.url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-06-27 15:51:50 +00:00
|
|
|
def get_company_name
|
|
|
|
if self.company_name.empty?
|
|
|
|
case I18n.locale
|
|
|
|
when :en
|
|
|
|
cname = self.company_name_translations["zh_tw"]
|
|
|
|
when :zh_tw
|
|
|
|
cname = self.company_name_translations["en"]
|
|
|
|
end
|
|
|
|
else
|
|
|
|
cname = self.company_name
|
|
|
|
end
|
|
|
|
return cname
|
|
|
|
end
|
|
|
|
|
2017-12-29 12:00:33 +00:00
|
|
|
def get_industry
|
|
|
|
RecruitmentIndustry.find(self.industry).industry_title rescue ""
|
|
|
|
end
|
|
|
|
|
2017-12-21 19:41:50 +00:00
|
|
|
end
|