ActsAsParanoid / acts_as_paranoid

ActiveRecord plugin allowing you to hide and restore records without actually deleting them.
MIT License
1.45k stars 190 forks source link

Why can not use like this User.first.update!(deleted_at: Time.now) #285

Closed wangxinyun1995 closed 2 years ago

wangxinyun1995 commented 2 years ago
TRANSACTION (0.2ms)  ROLLBACK
Traceback (most recent call last):
        1: from (irb):5:in `<main>'
ActiveRecord::RecordNotSaved (Failed to save the record)
mvz commented 2 years ago

Deleted models are immutable in Rails. Just use User.first.destroy instead.