Sha256: 5df440a255917ddb6db514f087a366e00192de8494982e5cdb5033df072eeff3
Contents?: true
Size: 785 Bytes
Versions: 19
Compression:
Stored size: 785 Bytes
Contents
module Shipit module Api class LocksController < BaseController require_permission :lock, :stack params do requires :reason, String, presence: true end def create if stack.locked? render json: {message: 'Already locked'}, status: :conflict else stack.update(lock_reason: params.reason, lock_author: current_user) render_resource stack end end params do requires :reason, String, presence: true end def update stack.update(lock_reason: params.reason, lock_author: current_user) render_resource stack end def destroy stack.update(lock_reason: nil, lock_author: nil) render_resource stack end end end end
Version data entries
19 entries across 19 versions & 1 rubygems