added experience

This commit is contained in:
Harry Bomrah 2018-01-12 16:43:26 +08:00
parent 7168ba662f
commit 5be0e54280
3 changed files with 31 additions and 7 deletions

View File

@ -168,18 +168,23 @@ class RecruitmentsController < PseudoSessionController
academics = []
profile.employee_academics.each do |aca|
if !aca.end_date.nil?
period = aca.start_date.strftime("%Y/%m/%d") + " ~ " + aca.end_date.strftime("%Y/%m/%d")
else
period = aca.start_date.strftime("%Y/%m/%d") + " ~ current"
end
academics << {
"title" => (t("recruitment.academic_type.#{aca.academic_type}") + " " + t("recruitment.in") + " " + aca.degree_name),
"period" => period,
"period" => aca.period,
"note" => aca.note
}
end
experiences = []
profile.employee_experiences.asc(:end_date).each do |exp|
experiences << {
"job-title" => exp.job_title,
"company-name" => exp.company_name,
"period" => exp.period,
"responsibilities" => exp.responsibilities
}
end
if profile.experience_years == 0 && profile.experience_months == 0
experience = t("recruitment.fresher")
else
@ -190,6 +195,7 @@ class RecruitmentsController < PseudoSessionController
"skills" => skills,
"infos" => infos,
"academics" => academics,
"experiences" => experiences,
"recommendations" => recommendations,
"data" => {
"name" => rp.name,

View File

@ -9,4 +9,14 @@ class EmployeeAcademic
field :note, localize: true
belongs_to :employee_profile
def period
if !self.end_date.nil?
period = self.start_date.strftime("%Y/%m/%d") + " ~ " + self.end_date.strftime("%Y/%m/%d")
else
period = self.start_date.strftime("%Y/%m/%d") + " ~ current"
end
period
end
end

View File

@ -10,5 +10,13 @@ class EmployeeExperience
belongs_to :employee_profile
def period
if !self.end_date.nil?
period = self.start_date.strftime("%Y/%m/%d") + " ~ " + self.end_date.strftime("%Y/%m/%d")
else
period = self.start_date.strftime("%Y/%m/%d") + " ~ current"
end
period
end
end