Class: WipeOut::Validate

Inherits:
Object
  • Object
show all
Defined in:
lib/wipe_out/validate.rb

Overview

Validates plan has proper configuration and that all ActiveRecord class attributes are explicily defined in the plan. Validation is a seperate step, after plan is defined. We don't assume plan is valid stadalone, this allows for plans composition.

Constant Summary collapse

VALIDATORS =
[
  Validators::Attributes,
  Validators::DefinedRelations,
  Validators::RelationsPlans
].freeze

Instance Method Summary collapse

Instance Method Details

#callArray<String>

Returns:

  • (Array<String>)


18
19
20
21
22
23
24
# File 'lib/wipe_out/validate.rb', line 18

def call
  VALIDATORS.map do |validator|
    validator.call(plan, ar_class, config, result)
  end

  result
end