Topic: Creating a time based sweeper cleaner type method

First, i don't know what this something like this is really called. I called it a sweeper type method, because what i would want it to do is sweep something based on time.

What is my goal? I am going to be working on application and creating a demo account and i want a method to clean out anything that is created on that account in a given time amount, say a day.

I am posting this in the theory section, because that all i am looking for is some advice on how to implement or some insight on how a method persists in rails.

I am cool with cron jobs for cleaning tmp directory, but i want to put this functionality into the rails app, unless it's a dumb idea.

So sorry if this actually has a proper name that i can google for it and search this forum, but i just don't know it.

thanks for any help

Re: Creating a time based sweeper cleaner type method

You can just have cron run a ruby script that will do this. If you need access to the Rails models, etc. You can just include your rails environment.rb file - this will make all models and such available to you. Just as if you were in script/console.

require 'path/to/environment.rb'

Railscasts - Free Ruby on Rails Screencasts

Re: Creating a time based sweeper cleaner type method

Sounds good i think that might work.

thanks Ryan