On Jan 7, 2:07 am, Piotr <don.pi...@yahoo.it> wrote:
> Hi,
>
> I really don't understand why model's validation.
> In form i have many camps that don't exist in database,
> or it's value have to be processed before i put it in database.
>
> Examples: password that i have to encode;
> password confirmation that i have to look is it right;
> data camps (one for days, one for month, one for year) i have to join
> in one variable.
>
> For sure there are many other examples.
>
> Everything of that I have to do before I sand values to my model.
> So all valdation I should make outside of model.
>
> Somebody can explain for my this.

Model validation is purely optional, no validations are done by
default.  If you want to use external validations before putting data
in the model, that's perfectly fine.

That being said, most users choose to use internal model validations,
which still validate data before sending it to the database.

IMO, model validation at the ruby level is purely about giving nice
error messages to the users.  Robust applications should be using
database constraints for data integrity where possible.

Jeremy

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

Reply via email to