small fix

This commit is contained in:
Bomrah Harry 2018-07-18 18:25:34 +08:00
parent 888186404c
commit 434df605a7
1 changed files with 5 additions and 5 deletions

View File

@ -83,13 +83,13 @@ class RecruitmentsController < PseudoSessionController
rjobs = RecruitmentJob.where(:post_type => type).not_filled
end
if !rjobs.nil? && !rjobs.is_a?(Array)
rjobs = rjobs.desc(:created_at).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count)
rjobs = rjobs.excluded_expired.desc(:created_at).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count)
total_pages = rjobs.total_pages
else
rjobs = []
total_pages = 0
end
rjobs = rjobs.excluded_expired
rjobs.each do |rj|
if rj.work_experience_years == 0 && rj.work_experience_months == 0
wey = t("recruitment.fresher")
@ -490,11 +490,11 @@ class RecruitmentsController < PseudoSessionController
end
def create_experience
if params[:commit] == "Add"
if params[:commit] == "Add" || params[:commit] == "新增"
academic = EmployeeExperience.create(employee_exp_params)
redirect_to employee_experience_path
elsif params[:commit] = "Finish"
if params[:employee_experience][:job_title].present? || params[:employee_experience][:company_name].present?
elsif params[:commit] = "Finish" || params[:commit] == "完成"
if params[:employee_experience][:job_title_translations].present? || params[:employee_experience][:company_name_translations].present?
academic = EmployeeExperience.create(employee_exp_params)
end
redirect_to mydashboard_path