Class: Decidim::ValidateUpload
- Defined in:
- app/commands/decidim/validate_upload.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(form) ⇒ ValidateUpload
constructor
A new instance of ValidateUpload.
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
#call ⇒ Object
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 |