Validations
Reported by Dan Schultz | January 15th, 2011 @ 02:23 AM | in 0.1.0
Add support for validating entities before a save operation occurs. If an entity fails to validate, the save should fail.
Here's the approach to running validations:
- By default, executing a save on an entity will run its validations.
- Validations are executed through the beforeSave callback.
- If the entity has any errors, it will cause its save operation to fault.
- If any entity within a group of entities is invalid, it will cause the whole group to fail.
Defining Validations:
public class User extends Entity
{
public static const validate:Object = {
name: [{validator: Length, minimum: 0, message: "Name is too short"}],
email: [{validator: Email}]
}
public function User()
{
}
}
Comments and changes to this ticket
-
Dan Schultz January 15th, 2011 @ 02:44 AM
- Tag changed from validations to feature, validations
-
Dan Schultz January 17th, 2011 @ 12:33 AM
- State changed from new to open
-
Dan Schultz January 18th, 2011 @ 07:40 PM
- State changed from resolved to open
-
Dan Schultz January 19th, 2011 @ 08:48 PM
- State changed from open to resolved
(from [4c89bbe90bfcddff7a35cf2d9b1b01a4edf4094e]) trigger validations on save [#1 state:resolved] https://github.com/danschultz/mesh/commit/4c89bbe90bfcddff7a35cf2d9...
-
Dan Schultz January 20th, 2011 @ 02:08 AM
- State changed from resolved to open
-
Dan Schultz January 20th, 2011 @ 02:09 AM
- State changed from open to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Mesh is an open-source persistence framework for Adobe Flex. It is designed to make the persistence of your application's model easier. Mesh provides the mechanisms for defining the associations between your model's entities, tracking which objects need to be saved, and mapping your entities to backend services.
<p>
<strong>Wiki</strong>
The Mesh wiki is hosted on GitHub at <a href="https://github.com/danschultz/mesh/wiki">https://github.com/danschultz/mesh/wiki</a>.
</p>
<p>
<strong>Source Code</strong>
Mesh is hosted on GitHub at <a href="http://github.com/danschultz/mesh">http://github.com/danschultz/mesh</a>.
</p>