Sha256: daceb0b5c91d54d42c5ad8d1f8a9ddc9ddeaacacc05de0ab38516080dc852873

Contents?: true

Size: 845 Bytes

Versions: 16

Compression:

Stored size: 845 Bytes

Contents

require_dependency "think_feel_do_engine/application_controller"

module ThinkFeelDoEngine
  module Participants
    # Updates the completion of assigned tasks for a participant
    class TaskStatusController < ApplicationController
      before_action :authenticate_participant!

      rescue_from ActiveRecord::RecordNotFound, with: :record_not_found

      def update
        @task_status = current_participant
                       .active_membership
                       .task_statuses
                       .find(params[:id])

        if @task_status.engagements.build && @task_status.mark_complete
          render nothing: true, status: 200
        else
          render nothing: true, status: 400
        end
      end

      private

      def record_not_found
        render nothing: true, status: 404
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
think_feel_do_engine-3.14.0 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.13.1 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.13.0 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.9 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.8 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.7 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.6 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.5 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.4 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.3 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.2 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.1 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.12.0 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.11.3 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.11.0 app/controllers/think_feel_do_engine/participants/task_status_controller.rb
think_feel_do_engine-3.10.10 app/controllers/think_feel_do_engine/participants/task_status_controller.rb