I thought you might say that.  Still, wouldn't a valid paradigm be

begin
  model.update(stuff)
  puts "Update successful"
rescue Sequel::ValidationError
  puts "Update failure: validation problem"
  puts model.errors.inspect
end

work even for web apps?  (with something smarter than "puts", of
course)

On Apr 14, 9:29 am, Jeremy Evans <[email protected]> wrote:
> On Apr 14, 9:17 am, Max A <[email protected]> wrote:
>
> > Well, the cause of the problem was that in my code the user model
> > wasn't getting reloaded after failing validation, so my session user
> > object would look like whatever the user put in the form until they
> > logged back out and back in...
>
> > As for the rest of the explanation, it was very helpful!  I very much
> > appreciate you taking the time to write it.
>
> > Just out of curiosity...why aren't raise_on_*_failure true by default
> > if most web applications will want that?
>
> Sequel is a general database library, it is not aimed primarily at web
> applications (unlike ActiveRecord).  If you aren't programming a web
> application, the default strictness helps catch bugs.  The only time
> you should turn the strictness off is if you need to deal with
> untrusted user input and still provide nice error messages to users (a
> common web applications need).
>
> Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to