Sha256: f2cbeb5f9de6747669de25d5176a415e0d32c26e4b38402225d431d01cee6f16
Contents?: true
Size: 410 Bytes
Versions: 1
Compression:
Stored size: 410 Bytes
Contents
# frozen_string_literal: true module Decidim module Posts class DestroyPost < Decidim::Command def initialize(post, current_user) @post = post @current_user = current_user end def call return broadcast(:invalid) unless @post.authored_by?(@current_user) || @current_user.admin? @post.destroy! broadcast(:ok, @post) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
decidim-posts-1.0.0 | app/commands/decidim/posts/destroy_post.rb |