On Apr 9, 12:20 pm, Michael Lang <[email protected]> wrote:
> This is actually one case where I liked ActiveRecord's approach of using
> bang ("!") to be more forceful in intent.
>
> a.delete
> a.save! # raise error if doesn't exist
> a.delete! # raise error if doesn't exist

I dislike using the bang in such cases as it's not obvious what it
stands for.  ActiveRecord's save! is used for similar reasons as
Sequel's raise_on_save_failure flag, so using save! for this new
functionality is definitely not something I want to do.  Sequel
actually did support save! when I took over maintenance, I removed it
in 2.0 I think.

Also, using bang versions to enable this would send the wrong message,
as the bang implies additional danger.  Personally, I think that
silently ignoring errors is more dangerous than raising them, so if I
added the bang version, it would be for the current behavior, with the
nonbang version raising the error.

The Sequel approach to this is to have class and instance flags that
affect the behavior of the object:

A.strict_modification = false # class default
a.strict_modification = true # instance override
a.save

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