Validate things that your application is going to rely on, regardless
if the values are from user input or set programatically. That
usually includes the validating presence_of key data fields and
associations. Stick to the important stuff and don''t waste your time
crafting complicated validations that are just going to frustrate you
and your users.
It''s easy to blow half a day creating a phone number regex validation
that''s a work of art. But that falls apart when a user wants to enter
"123-456-7890 (don''t call after 5 pm)".
Aaron
On Feb 1, 12:37 pm, Earle Clubb
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I''m building validations in a model which contains user input as
well as
> hard-coded and program-generated values. Is the purpose of validation
> to protect the db from bad user data, or possible programmer errors
> (typos, etc) as well? How paranoid should I be in my validations?
>
> Earle
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---