codegram / date_validator

A simple, ORM agnostic, Ruby >=2.2 compatible date validator for Rails, based on ActiveModel.
http://thoughts.codegram.com/date-validation-with-rails-3
MIT License
495 stars 82 forks source link

Not really ORM-Agnostic #75

Open HoneyryderChuck opened 7 years ago

HoneyryderChuck commented 7 years ago

This gem doesn't work for Sequel, not outside of the box at least. The EachValidator object is AFAIK only defined in Rails, and is not part of the ActiveModel spec.

One could remove the ORM-agnostic description (unless there's morethan ActiveRecord this gem supports) or build a validation method to be added to Sequel::Model when loading the ValidationHelpers plugin.

jufemaiz commented 7 years ago

@TiagoCardoso1983 are you correctly including ActiveModel::Validations?

http://api.rubyonrails.org/classes/ActiveModel/Validator.html

HoneyryderChuck commented 7 years ago

sequel has its own validations plugin, and therefore doesn't use activemodel validations. If this gem requires them, then it is neither ORM-agnostic nor Rails-agnostic. Am I correct inferring this? Because if so, you could at least update the "ORM-agnostic" disclaimer in the README.