Sha256: aed418819cd350fd50839d0a8d2a7e2c15dba05a415f256e62691065c0866f32

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 Bytes

Contents

module Signum
  class SignalController < ApiController
    def show
      signal = Signum::Signal.find(signal_params[:id])
      signal.show! if signal.broadcasted?
      head :ok
    end

    def close
      signal = Signum::Signal.find(signal_params[:id])
      signal.close!
      head :ok
    end

    def close_all
      signals = Signum.config.current_user.call.signals.where.not(state: "closed")
      signals.each(&:close!)
      head :ok
    end

    private

    def signal_params
      params.require(:signal).permit(:id)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
signum-0.7.2 app/controllers/signum/signal_controller.rb