fukamachi / integral

[OBSOLETE] Use Mito instead.
https://github.com/fukamachi/mito
BSD 3-Clause "New" or "Revised" License
54 stars 3 forks source link

Validation before save. #30

Closed pocket7878 closed 9 years ago

pocket7878 commented 9 years ago

Add "validations" slots to with built-in shortcut validation functions. User can add validation before {insert | update}-dao.

fukamachi commented 9 years ago

Thank you for the great contribution!

I'd like to ask something:

fukamachi commented 9 years ago

BTW, have you seen this library? https://github.com/mmontone/clavier It's quite new and is going to be included in Quicklisp this month.

fukamachi commented 9 years ago

CC @Rudolph-Miller

pocket7878 commented 9 years ago

Currently I just ignoring when validation is failed. In Rails's ActiveRecord default behavior of validation-failure is just ignoring them (return false). Rails also has banged-crud-method(e.g save!) which throws exception when the validation has failed. So should I add same methods to user can handle validation-failure?

When the validations has failed I want to just ignoring them, so I added :around method to interrupt base method calling.

clavier is look so great :smile:

Well, on second thought, it might be better separate validations to library to add validation dynamically. Thank you for your advice!