On Monday, August 13, 2012 11:07:52 PM UTC-7, Christian MICHON wrote: > One problem though: using this code, my saved Human object 'Bobby' > gets its id = 2, because 1st save did not work: is this the expected > behavior? >
The reason you get id 2 is that it actually tries to do the insert for the first save. That's because you didn't use the constraint_validations plugin in the Human model (you only used the Database extension). If you use the model plugin, the validation code should see the name Bob as invalid and should not attempt the insert. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/NcfC8Fhmb-0J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
