On Jan 16, 2008 4:16 AM, Sharon Rosner <[EMAIL PROTECTED]> wrote:
>
> hi everybody
>
> the new validations implementation is in the trunk, so please give it
> a whirl. i've tried to follow the validation specs as implemented in
> ActiveRecord, rather than the validatable gem which is incomplete and
> even wrong in a couple places.
>
> There are some things missing, like a smarter #errors (right now it's
> just a simple array of error messages), and some of the validations
> are missing a few options.
>
> Right now Model#save returns false and doesn't save if validations
> fail. There's a new Model#save! method that saves regardless of
> validations. Also missing is ability to inherit validations in
> subclasses, but that will come real soon.
>

Sharon,

Good stuff!  I took a look around the new validations and things look
pretty tight.  Of course like you say the big things that are missing
are being able to query to the validity of a particular attribute.
This could be done by making the errors array into a smarter object
like in AR.

I know this is a requirement for code out there like merb's form
helpers which die after querying for model attribute status like:

def errorify_field(attrs, col)
  attrs.add_html_class!("error") if @_obj.respond_to?(:errors) &&
@_obj.errors.on(col)
end

Of course the last comparison will fail in Sequel as Array doesn't
have an on(...) method...

Looking forward to the last phases of the validation refactoring and
overall I'm really liking Sequel!

Best,

Zack

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to sequel-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to