Class: Decidim::ValidateUpload

Inherits:
Command
  • Object
show all
Defined in:
app/commands/decidim/validate_upload.rb

Instance Method Summary collapse

Methods inherited from Command

call, #evaluate, #method_missing, #respond_to_missing?, #transaction

Constructor Details

#initialize(form) ⇒ ValidateUpload

Returns a new instance of ValidateUpload.



5
6
7
# File 'app/commands/decidim/validate_upload.rb', line 5

def initialize(form)
  @form = form
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Decidim::Command

Instance Method Details

#callObject



9
10
11
12
13
# File 'app/commands/decidim/validate_upload.rb', line 9

def call
  return broadcast(:invalid, @form.errors) if @form.invalid?

  broadcast(:ok)
end