# frozen_string_literal: true module CommandTag::Commands::StatusTools def handle_publish_once_at_end return unless author_of_parent? && !@parent.published? PublishStatusService.new.call(@parent) end def handle_edit_once_before_save return unless author_of_parent? params = @parent.slice(*UpdateStatusService::ALLOWED_ATTRIBUTES).with_indifferent_access.compact params[:text] = @text UpdateStatusService.new.call(@parent, params) destroy_status! end end