This is a little OT, but:

I'm a little bit leery of default_scope because of my experience with
is_paranoid - both the issues outlined in the author's note here
http://blog.semanticart.com/2009/10/13/killing-is-paranoid.html and several
pretty nasty gotchas working with is_paranoid. Some of them were
attributable to the author complicating it substantially trying to work
around all the potential pitfalls; some were the pitfalls themselves.

I haven't used DS that I can remember in recent times, (and maybe my
aversion is wrongheaded) but I prefer to keep my scopes explicit these days.
YMMV.

On Tue, Mar 16, 2010 at 1:38 PM, Ben Hoskings <[email protected]> wrote:

> On 16/03/2010, at 1:36 PM, Cameron Barrie wrote:
>
> > that is true.
> > find(:conditions => "confirmation IS true") littering everything sux.
> >
> > Surely there's a good way to dry that up though?
>
> Yep, a default scope will clean it up:
>
> class Entry < ActiveRecord::Base
>  default_scope :conditions => "confirmed_at IS NOT NULL"
> end
>
> It's still a little gnarly though :)
>
> —ben_h
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rails-oceania%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
>
>


-- 
cheers,
David Lee

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" 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/rails-oceania?hl=en.

Reply via email to