I’m creating a simple paste-bin in Ruby on Rails, which will have an expire-feature. With this, people can select a date when the paste will be deleted automatically. How can I implement this? I was thinking of a cronjob, but maybe there is a more platform-independent way, by defining this in the model itself.
I’m creating a simple paste-bin in Ruby on Rails, which will have an expire-feature.
Share
cronwill work fine. You can make aRaketask that performs the actual deletions, and then trigger that fromcron.Alternatively, you could keep the data forever and simply quit showing any records that have expiration dates in the past.