Sha256: da19507e5f743d134393d9dd259e6e60eadd5692818e36b63a47037e353bb90c

Contents?: true

Size: 349 Bytes

Versions: 6

Compression:

Stored size: 349 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # A command with all the business logic to destroy a category in the
    # system.
    class DestroyCategory < Decidim::Commands::DestroyResource
      protected

      def invalid?
        resource.nil? || resource.subcategories.any? || !resource.unused?
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/commands/decidim/admin/destroy_category.rb
decidim-admin-0.29.0 app/commands/decidim/admin/destroy_category.rb
decidim-admin-0.29.0.rc4 app/commands/decidim/admin/destroy_category.rb
decidim-admin-0.29.0.rc3 app/commands/decidim/admin/destroy_category.rb
decidim-admin-0.29.0.rc2 app/commands/decidim/admin/destroy_category.rb
decidim-admin-0.29.0.rc1 app/commands/decidim/admin/destroy_category.rb