From 1c765fa0537edd9271142179dde136f783854041 Mon Sep 17 00:00:00 2001 From: Bomrah Harry Date: Wed, 18 Jul 2018 23:57:29 +0800 Subject: [PATCH] fix and dependency --- app/controllers/recruitments_controller.rb | 4 ++-- app/models/employee_profile.rb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/recruitments_controller.rb b/app/controllers/recruitments_controller.rb index 5915a69..c80a710 100644 --- a/app/controllers/recruitments_controller.rb +++ b/app/controllers/recruitments_controller.rb @@ -415,9 +415,9 @@ class RecruitmentsController < PseudoSessionController if profile.is_employer? redirect_to mydashboard_path elsif profile.is_employee? - if params[:commit] == "Next" && params[:step] == "step1" + if (params[:commit] == "Next" || params[:commit] == "下一個" ) && params[:step] == "step1" redirect_to employee_academics_path - elsif params[:commit] == "Save" + elsif params[:commit] == "save" || params[:commit] == "儲存" redirect_to mydashboard_path end end diff --git a/app/models/employee_profile.rb b/app/models/employee_profile.rb index b8620db..2453019 100644 --- a/app/models/employee_profile.rb +++ b/app/models/employee_profile.rb @@ -35,10 +35,10 @@ class EmployeeProfile belongs_to :recruit_profile - has_many :employee_academics - has_many :employee_experiences - has_many :employee_job_applications - has_many :employee_recommendations + has_many :employee_academics, :autosave => true, :dependent => :destroy + has_many :employee_experiences, :autosave => true, :dependent => :destroy + has_many :employee_job_applications, :autosave => true, :dependent => :destroy + has_many :employee_recommendations, :autosave => true, :dependent => :destroy scope :job_seekers, ->{where(:active => true)}