Any model-validation library without ActiveSupport dependency?

Hello, is there any model-validation library without dependency on
ActiveSupport?

I can’t find any.

On Wed, Aug 24, 2011 at 11:31 AM, Alexey P. [email protected]
wrote:

Hello, is there any model-validation library without dependency on
ActiveSupport?

I can’t find any.

DataMapper and dm-validations has no dependency on ActiveSupport. I
suspect
the minimalist ORM/Model layer is the same, but I don’t know if it has
any
validations either.

Were you looking for any solution, or an ActiveRecord only solution?

Thanks.

But it has dependency on the dm-core (DataMapper), so it seems that it
can be used with DataMapper only.

On Aug 24, 2011, at 4:31 AM, Alexey P. wrote:

Hello, is there any model-validation library without dependency on
ActiveSupport?

Yes, Sequel[1] supports model validations[2].
[1] http://sequel.rubyforge.org/
[2] http://sequel.rubyforge.org/rdoc/files/doc/validations_rdoc.html

On Wed, Aug 24, 2011 at 12:42 PM, Alexey P. [email protected]
wrote:

Thanks.

But it has dependency on the dm-core (DataMapper), so it seems that it
can be used with DataMapper only.

Model validations by their nature are very intimate with the ORM.

Another approach may be to use something like bureaucrat (an ORM
agnostic
form helper) or validations that are at the controller/view level.

It is not DRY, as those validations are not performed in console or
through
an API layer, but a lot of the benefit of validations occurs between the
user and the keyboard.

regards,
Richard

The dm-validations is subjected to be used with non datamapper models.
It has support for plain old ruby objects.

For example I am already using it with virtus.

Model validations by their nature are very intimate with the ORM.
Hmm, I see this from a little different point - validations is nothing
more than a set of DSL and rules to define expectations about Ruby
objects. It has a very little to do with ORM (only: valid?, errors & a
little of sugar-syntax, and even all these methods are ORM agnostic by
their nature).

I forked the ‘jnunemaker-validatable’ (latest updated version of old
validatable gem) and removed all the ActiveRecord stuff from there,
tests are passed and it seems to work (I pushed it as the validatable2
gem).

The dm-validations is subjected to be used with non datamapper models. It has
support for plain old ruby objects.

The dm-validations is subjected to be used with non datamapper models. It has
support for plain old ruby objects.
Maybe it’s applicable also to plain objects, but it still requires
dm-core and it adds unnecessary dependencies and potentially can cause
incompatibilities.