Filtering all find methods so expired records not returned

Is there a way to filter all finder methods on a model so that all
records where the expired column=1 are not returned??

Thanks
Chris

Hey Chris,

Check out acts_as_paranoid [1]. It’ll probably do exactly what you
need, though you may need to modify your db just a tad. If you’re
working with a legacy db and the plugin doesn’t work for you, you can
just go ahead and adapt the plugin code to work with your db.

Pat

[1] http://ar-paranoid.rubyforge.org/

Chris wrote:

Is there a way to filter all finder methods on a model so that all
records where the expired column=1 are not returned??

Thanks
Chris

Model.find(:all, :conditions => ‘expired_column = 1’

Then put this in a method like:

def Model.find_all_not_expired
Model.find(:all, :conditions => ‘expired_column = 1’)
end

Joey
http://www.feedreed.com