Class: HrLite::Admin::DesignationChangesController

Inherits:
SuperadminController show all
Defined in:
app/controllers/hr_lite/admin/designation_changes_controller.rb

Overview

Standalone role change (promotion without an appraisal).

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/hr_lite/admin/designation_changes_controller.rb', line 11

def create
  @change = DesignationChange.new(change_params.merge(
    user_id: @profile.user_id, created_by_id: hr_current_user.id
  ))
  if @change.save
    redirect_to admin_employee_path(@profile), notice: "Role change recorded."
  else
    render :new, status: :unprocessable_entity
  end
end

#newObject



7
8
9
# File 'app/controllers/hr_lite/admin/designation_changes_controller.rb', line 7

def new
  @change = DesignationChange.new(user_id: @profile.user_id, effective_date: Date.current)
end