On May 3, 5:15 pm, Jeremy Evans <[email protected]> wrote:
> On May 3, 4:48 pm, MaggotChild <[email protected]> wrote:
> > Is there a setting and/or alternate method that would throw an
> > exception if a record was not found?
>
> No one has asked for it.  I don't have a personal need for it, but if
> there is strong community demand, I'd consider a patch.  It's fairly
> easy to add a method to Sequel::Model yourself that raises instead of
> returning nil if a record is not found, FWIW.

Useually several actions retrieve a single record and maybe some child
records. When this record is not found I think it's easier to handle
it once, for all actions, with a 404 via rescue_from. I believe a
similar functionality can be achieved with a before_filter or, as
you've said, I can modify Sequel::Model. Anything to avoid the
repetitiveness of checking for nil in an action or view.

What do you useually do?


-- 
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