intridea/grape — pull request #754 by oliverbarnes (2014-09-12 14:50:45+00:00)
Title: WIP validations refactor

Second stab at refactoring validations (first one [here](https://github.com/intridea/grape/pull/644)).

- Moved validators into /lib/grape/validations/validators
- Moved Validations::ParamsScope and Validations::Validator::AttributesIterator into their own files, and removed AttributesIterator under the Validator namespace
- Renamed Validations::Validator to Validations::Base
- Moved single option-specific code into Base, doing away with SingleOptionValidator
- Autoloading of validations constants in lib/grape.rb (not working yet)

Questions:

- How to test ParamsScope?
- How to load validators without requiring them in validations.rb?

Possible further refactoring:

- Moving validation methods out of ParamsScope into Validations?
- Refactor big private methods like #require_required_and_optional_fields and #validates, perhaps extracting a few classes