func ModelValidator() *Callback {
	return C("fire/ModelValidator", Only(Create, Update), func(ctx *Context) error {
		// check model
		m, ok := ctx.Model.(ValidatableModel)
		if !ok {
			return fmt.Errorf("model is not validatable")
		}

		// validate model
		err := m.Validate()
		if err != nil {
			return err
		}

		return nil
	})
}
func ModelValidator() *Callback {
	return C("fire/ModelValidator", Only(Create, Update), func(ctx *Context) error {
		
		m, ok := ctx.Model.(ValidatableModel)
		if !ok {
			return fmt.Errorf("model is not validatable")
		}

		
		err := m.Validate()
		if err != nil {
			return err
		}

		return nil
	})
}
func ModelValidator ( ) * Callback { return C ( " " , Only ( Create , Update ) , func ( ctx * Context ) error { // check model m , ok := ctx . Model . ( ValidatableModel ) if ! ok { return fmt . Errorf ( " " ) } // validate model err := m . Validate ( ) if err != nil { return err } return nil } ) }
// ModelValidator performs a validation of the model using the Validate method.
ModelValidator performs a validation of the model using the Validate method .