:ECONNREFUSED(连接被拒绝 - 连接(2)为“localhost”端口25):

时间:2016-05-05 05:10:47

标签: ruby-on-rails

  

嗨我有2张桌子员工&用户表,如果我使用员工表   在用户中也应该停用该员工,但是   当我犯这个错误时,任何人都可以告诉我我   错。

employee_controller.rb

def change_status
    if params[:employee][:status] == "Abscond"
        params[:employee][:last_working_date] = params[:emp_last_date]
    elsif params[:employee][:status] == "Resigned" || params[:employee][:status] == "Internal Resignation"
        params[:employee][:resignation_date] = params[:emp_last_date]
    end
    params[:employee].delete(:entity_id) if params[:employee][:entity_id].blank?
    params[:employee].delete(:activate_reason) if params[:employee][:activate_reason].blank?
    if @user.present?
        @user.lock_access!
    end
    @employee.update_attributes(employee_params.merge!("updated_by" => current_user.id))
    respond_with(@employee)
end

User_controller.rb

 def change_status
    if @user.access_locked?
        @user.unlock_access!
    else
        @user.lock_access!
    end
    respond_with(@user)
end

if the employee get deactive means Abscond||resigned||internal designation means User should be get inactive, but using this only USer is getting in active not an employee...
Im trying to change the status from employee 

0 个答案:

没有答案