Class: Planter::Validator
- Inherits:
-
Object
- Object
- Planter::Validator
- Defined in:
- lib/planter/validator.rb
Overview
Performs read-only validation of the configured seed plan.
The validator checks that requested seeders can be loaded, that built-in seeding methods have the files or data they need, and that the configured adapter exposes Planter's public adapter API.
Defined Under Namespace
Classes: Result
Constant Summary collapse
- REQUIRED_ADAPTER_METHODS =
Adapter methods required for Planter's public adapter API.
%i[ create_record parent_ids foreign_key table_columns table_names ].freeze
Instance Method Summary collapse
-
#initialize(config: Planter.config, seeders: nil) ⇒ Validator
constructor
Create a validator.
-
#validate ⇒ Planter::Validator::Result
Validate the seed plan without creating, updating, or deleting records.
Constructor Details
Instance Method Details
#validate ⇒ Planter::Validator::Result
Validate the seed plan without creating, updating, or deleting records.
87 88 89 90 91 92 |
# File 'lib/planter/validator.rb', line 87 def validate seeders_present = validate_seeders_present validate_adapter validate_seeders if seeders_present result end |