Class: HrLite::Admin::ChecklistsController
- Inherits:
-
BaseController
- Object
- HrLite::ApplicationController
- BaseController
- HrLite::Admin::ChecklistsController
- Defined in:
- app/controllers/hr_lite/admin/checklists_controller.rb
Overview
Joining and leaving, step by step, with what is overdue at the top.
Instance Method Summary collapse
Instance Method Details
#complete ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/hr_lite/admin/checklists_controller.rb', line 15 def complete item = ChecklistItem.find(params[:id]) item.complete!(actor: hr_current_user, note: params[:note]) redirect_to admin_checklists_path(kind: item.kind), notice: "#{item.title} — done." end |
#index ⇒ Object
8 9 10 11 12 13 |
# File 'app/controllers/hr_lite/admin/checklists_controller.rb', line 8 def index @kind = params[:kind].presence_in(ChecklistTemplate::KINDS) || "onboarding" @items = ChecklistItem.for_kind(@kind).outstanding.includes(:user) .order(Arel.sql("due_on IS NULL, due_on")) @overdue = @items.select(&:overdue?) end |
#reopen ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/hr_lite/admin/checklists_controller.rb', line 21 def reopen item = ChecklistItem.find(params[:id]) item.reopen!(actor: hr_current_user) redirect_to admin_checklists_path(kind: item.kind), notice: "#{item.title} — reopened." end |