Re: Validation levels: errors, warnings

Michael Koziarski
Sun, 04 May 2008 01:53:49 -0000

>  All of the above can, of course, be easily added to the classes where it
>  is needed, or duck punched into ActiveRecord. What I''d like to
have is
>  a way to use the already existing validations for custom validation
>  levels, too. To be clear, I don''t want any further levels to be
added
>  to AR, but I want the necessary hooks to add them myself in an app or
>  plugin.

What kind of hooks do you have in mind?  I''m always a little suspect
of adding ''hooks'' for some theoretical future extensibility,
but
there''s definitely some scope for improving the implementation of the
validations.

I''ve always found it a little frustrating that the actual logic for
''validating the presence of'' isn''t encapsulated in a
single function
that you can call from your own validations.  So the validations could
be used in situations where the macros don''t apply.

--
Cheers

Koz