Generally we use only one column for this scenario. And we can write a local scope(s) to determine is expired or not
Nov 10, 2021
3
Level 4
How to create a model that expires?
I have users with teacher role in my system. I want to give them the ability to make some kind of request (model instance) that will create a submission page for their students activities.
My plan on doing this is to simply set a column for the expiration date and set a column that stores a boolean that will indicate if the model instance is expired or not.
My problem is, how do you change the boolean column value let's say to true if the current date and time matches the expiration date?
Level 104
1 like
Please or to participate in this conversation.