I have an Activity stream I have designed using STI in rails 3.
I want to do a check to see if a user has more than 10 activity items on create. When a user creates his 11th Activity in the database, I want it to destroy the oldest record * essentially the first record the user made and so on.* This way I am keeping my database clean of thousands of old useless records.
I am assuming I would start at the model level, but since I dont want to define the "current_user" in the model, it should be in the controller.
Any help would be appreciated to accomplish this task, I am fairly new at these type of more advanced tasks in rails.