app/commands/decidim/elections/admin/destroy_election.rb in decidim-elections-0.26.10 vs app/commands/decidim/elections/admin/destroy_election.rb in decidim-elections-0.27.0.rc1
- old
+ new
@@ -3,11 +3,11 @@
module Decidim
module Elections
module Admin
# This command is executed when the user destroys an Election
# from the admin panel.
- class DestroyElection < Rectify::Command
+ class DestroyElection < Decidim::Command
include ::Decidim::AttachmentMethods
include ::Decidim::GalleryMethods
def initialize(election, current_user)
@election = election
@@ -29,10 +29,10 @@
private
attr_reader :election, :current_user
def invalid?
- election.blocked?
+ election.started?
end
def destroy_election!
Decidim.traceability.perform_action!(
:delete,