KyivKrishnaAcademy/ved_akadem_students

View on GitHub
app/interactions/ui/attendance_destroying_interaction.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
57%
module Ui
  class AttendanceDestroyingInteraction < BaseInteraction
    def init
      resource.destroy

      @status = resource.destroyed? ? :no_content : :unprocessable_entity
    end

    def as_json(_opts = {})
      @as_json ||= errors_json(resource) unless resource.destroyed?
    end
  end
end