Is there a way to change a database records "created_at" variable after it created?
Sure, since rails 2.3 you can change it like any other column: get the object from the database, set the value for the column, save it.
my_model = MyModel.find(42)
my_model.created_at = Date.today
my_model.save
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With