Class: Moon::Action::ValidModelsRequired

Inherits:
Object
  • Object
show all
Defined in:
lib/moon/action/valid_models_required.rb

Overview

The action checks if every model in the context is valid.

Instance Method Summary collapse

Instance Method Details

#perform(context) ⇒ Object



5
6
7
8
9
# File 'lib/moon/action/valid_models_required.rb', line 5

def perform(context)
  @context = context
  validation_errors = validate_models
  validation_errors.empty? ? nil : Moon::Response::JSON::ValidationErrors.new(validation_errors)
end