Coming from ActiveRecord I was a bit perplexed by Sequel's behavior when 
validations fail.

In a Rails app I could simply run a condition on @model.valid? and keep it 
moving.

But Sequel actually throws an error, which breaks the app - so I find 
myself doing this:

begin @site.update(r.params[:site])
  flash.now[:done] = 'Update complete'
rescue Sequel::ValidationFailed
  flash.now[:fail] = 'Woops! Something went wrong.'
end

Which 100% works, but feels a bit clunky to me.

Am I going about this the right way?

Is there some hidden config/setting that I can tweak to change this 
behavior?

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to