Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor IngestTypeConfig #104

Open
afred opened this issue Nov 21, 2018 · 0 comments
Open

Refactor IngestTypeConfig #104

afred opened this issue Nov 21, 2018 · 0 comments

Comments

@afred
Copy link
Member

afred commented Nov 21, 2018

  • Use factory for IngestTypeConfig - use skip_create and initialize_with to create a non-ActiveRecord factory to DRY up ingest_type_config_spec.rb
  • Use ActiveModel validations to validate which config options are required and what types they should be.
  • Remove checks on the reader class and ingester class in IngestTypeConfig. If the classes aren't defined by the time they are used, default error of uninitialized constant should be good enough.
  • Could probably also get rid of several custom errors dealing with invalid config if we are using ActiveModel::Validations
  • Can still run validate! at the end of IngestTypeConfig constructor to immediately validate.

The ingest config file is part of the interface for interacting with batch ingest, therefore we should provide validation and meaningful feedback when a config file is invalid. Currently, the validation is ad hoc, but could be made a lot cleaner with ActiveModel::Validations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant