I want to automatically delete the data posted by the user after a certain period of time.

Asked 2 years ago, Updated 2 years ago, 36 views

We are creating SNS sites where users like Twitter can post.
Specifically, the Ruby on Rails Tutorial sample application has just been completed, and we are now trying to add functionality.
I would like to implement a function that automatically deletes data after a certain period of time (30 minutes) after the user posts it.

I tried using whenever and expires_in, but I couldn't erase it because I didn't know how to write it.

In the case of whenever, how should I write it on schedule.rb?
Also, if there is any other way, please let me know.

I apologize for the inconvenience, but I would appreciate it if you could reply.

ruby-on-rails ruby

2022-09-30 19:18

1 Answers

Rather than automatically deleting data from the database after a certain period of time, wouldn't it be easier to implement it if erb didn't display posts after a certain period of time?


2022-09-30 19:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.