Class: HrLite::Admin::ResignationsController
- Inherits:
-
LeadershipController
- Object
- HrLite::ApplicationController
- BaseController
- LeadershipController
- HrLite::Admin::ResignationsController
- Defined in:
- app/controllers/hr_lite/admin/resignations_controller.rb
Instance Method Summary collapse
Instance Method Details
#accept ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/hr_lite/admin/resignations_controller.rb', line 4 def accept resignation = Resignation.find(params[:id]) resignation.accept!( actor: hr_current_user, last_day: params[:last_day].presence&.to_date, note: params[:note] ) redirect_to admin_employees_path, notice: "Resignation accepted — exit date recorded on the profile." rescue ActiveRecord::RecordInvalid redirect_to admin_employees_path, alert: "Only pending resignations can be accepted." end |